Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9408

Windows feature detection macros assume Vista aware SDK headers.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.5
    • Affects Version/s: 2.4.2
    • Component/s: Build
    • None
    • Environment:
      Windows
    • Windows

      Note that this does not affect 2.5 which uses a different mechanism to check for windows features.

      In https://github.com/mongodb/mongo/blob/v2.4/src/mongo/platform/atomic_intrinsics_win32.h#L90

      we use the macro _WIN32_WINNT_VISTA to check against _WIN32_WINNT, but we don't first check that _WIN32_WINNT_VISTA is defined. So, if you try to build using a Windows SDK that predates the addition of the WIN32_WINNT_VISTA macro, the file will fail to compile.

      The solution is to change the code to:

      #if defined(_WIN32_WINNT_VISTA) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
      static const bool kHaveInterlocked64 = true;
      #else
      static const bool kHaveInterlocked64 = false;
      #endif

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: