Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#4991 closed defect (implemented)

Use standard windows-detection macros

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Keywords: easy windows cleanup tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

In our code, we mostly use MS_WINDOWS to detect windows; we sometimes use WIN32 to detect windows; and we sometimes use _WIN32.

_WIN32 is standard; WIN32 is obsolete; MS_WINDOWS is our own silliness. Let's be consistent and standard and just use WIN32.

Child Tickets

Change History (9)

comment:1 Changed 8 years ago by Sebastian

Wait, why would we pick WIN32 if it is obsolete? Shouldn't we pick _WIN32?

comment:2 Changed 8 years ago by nickm

Err, yeah. That's what I meant.

comment:3 Changed 8 years ago by nickm

Here's the script I propose to run over src/*/*.[ch]

#!/usr/bin/perl -w -i.bak -p

if (/^\s*\#/) {
    s/MS_WINDOWS/_WIN32/g;
    s/\bWIN32\b/_WIN32/g;
}

comment:4 Changed 8 years ago by nickm

Status: newneeds_review

comment:5 Changed 8 years ago by nickm

And if you'd rather have a branch than a perl script, see branch "bug4991" in my public repository.

comment:6 Changed 8 years ago by Sebastian

I have two fixups and a new commit in my branch bug4991, please check it out

comment:7 Changed 8 years ago by nickm

Resolution: implemented
Status: needs_reviewclosed

Thanks; squashing and merging.

comment:8 Changed 7 years ago by nickm

Keywords: tor-client added

comment:9 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.