[CDRIVER-891] Fix MinGW build Created: 30/Sep/15 Updated: 13/Jan/17 Resolved: 18/Jan/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libbson, mingw |
| Affects Version/s: | 1.1.2 |
| Fix Version/s: | 1.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Demelier David | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows, using MinGW-w64 |
||
| Issue Links: |
|
||||||||
| Description |
|
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 :
to something like this :
|
| Comments |
| Comment by A. Jesse Jiryu Davis [ 18/Jan/16 ] |
|
I'm going to close this for the moment, but please reopen and add more info when we get a chance so that we can figure out why the build broke on your system. Thanks. |
| Comment by A. Jesse Jiryu Davis [ 13/Jan/16 ] |
|
markand I thought I could reproduce this, but in fact it seems that the current release tarball works with MinGW-W64: https://github.com/mongodb/libbson/releases/download/1.3.0/libbson-1.3.0.tar.gz Can you tell me more about:
Thanks! |
| Comment by A. Jesse Jiryu Davis [ 08/Jan/16 ] |
|
I have a fix for a variety of MinGW problems in code review now. libbson will build and work with MinGW 4.9.1. Still to be determined:
|
| Comment by Demelier David [ 30/Sep/15 ] |
|
Update : after looking at bson-stdint-win32.h it seems absolutely not compatible with MinGW, maybe the build system can just copy the same bson-stdint.h as unix systems? |