Issue Details (XML | Word | Printable)

Key: LOGCXX-5
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Curt Arnold
Reporter: Curt Arnold
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4cxx

Preprocessor macro WIN32 used instead of _WIN32

Created: 03/Aug/04 04:41 AM   Updated: 03/Aug/04 06:03 AM
Return to search
Component/s: Build
Affects Version/s: 0.9.7
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works win32_macro.txt 2004-08-03 04:55 AM Curt Arnold 9 kB

Resolution Date: 03/Aug/04 06:03 AM


 Description  « Hide
Raised in http://nagoya.apache.org/eyebrowse/ReadMsg?listName=log4cxx-user@logging.apache.org&msgNo=176

log4cxx uses the WIN32 preprocessor macro in several places.
Microsoft Visual C++ and Borland C++ predefine the _WIN32 macro when
building on Win32, but not WIN32 (Visual Studio will explicitly add a
/DWIN32 to the command line by default). I checked the Xerces-C code
base to see how they handle this and they typically do something like:

#if defined(_WIN32) || defined(WIN32)

which would cause the appropriate Windows specific code to be compiled
without having to remember to add a /DWIN32 to the command line, but
would also support a hypothetical compiler that defined WIN32 but not
_WIN32. Unless there is a compelling reason to use WIN32 over _WIN32,
I would suggest changing to either _WIN32 or _WIN32 || WIN32.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Curt Arnold added a comment - 03/Aug/04 04:55 AM
Patch file changing #ifdef WIN32 to #if defined(WIN32) || defined(_WIN32)