• Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.1
    • Affects Version/s: 1.1.2
    • Component/s: libbson, mingw
    • None
    • Environment:
      Windows, using MinGW-w64

      The build system for libbson and libmongoc must keep straight the distinction between "compiling on Windows" and "compiling with Microsoft Visual C". There are many ifdefs that check for BSON_OS_WIN32 and then include MSVC-specific code. This breaks under MinGW since BSON_OS_WIN32 is true in MinGW but mostly, compiling with MinGW is the same as compiling on Unix.

      Most ifdefs that currently check for BSON_OS_WIN32 should instead check for _MSC_VER to

      ------

      Original report:

      bson-stdint.h not found when using MinGW:

      The bson.h requires including bson-stdint.h which is renamed to bson-stdint-win32.h on Windows.

      This is because the _MSC_VER is not defined (and is only defined with MSVC).

      I propose to change the following code :

      #ifdef _MSC_VER
      # include "bson-stdint-win32.h"
      // ... as before
      

      to something like this :

      #if defined(_WIN32)
      #  include "bson-stdint.h-win32.h"
      #endif
      
      #if defined(_MSC_VER)
      // ... as before specific for MSVC
      #endif
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            markand Demelier David
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: