Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-5

Preprocessor macro WIN32 used instead of _WIN32

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.9.7
    • None
    • Build
    • None

    Description

      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.

      Attachments

        1. win32_macro.txt
          9 kB
          Curt Arnold

        Activity

          People

            carnold@apache.org Curt Arnold
            carnold@apache.org Curt Arnold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: