Commit | Line | Data |
---|---|---|
279066b2 EZ |
1 | /* Fix issues related to MinGW 4.x handling of time data types. */ |
2 | ||
3 | #ifndef _MINGW_TIME_H | |
4 | #define _MINGW_TIME_H | |
5 | ||
6 | /* The @#$%^&! MinGW developers stopped updating the values of | |
7 | __MINGW32_VERSION, __MINGW32_MAJOR_VERSION, and | |
8 | __MINGW32_MINOR_VERSION values in v4.x of the runtime, to | |
9 | "discourage its uses". So the values of those macros can no longer | |
10 | be trusted, and we need the workaround below, to have a single set | |
11 | of macros we can trust. (The .17 minor version is arbitrary.) */ | |
12 | #ifdef __MINGW32__ | |
13 | #include <_mingw.h> | |
14 | #endif | |
15 | /* MinGW64 doesn't have this problem, and does not define | |
16 | __MINGW_VERSION. */ | |
17 | #ifndef __MINGW64_VERSION_MAJOR | |
18 | # ifndef __MINGW_VERSION | |
19 | # define __MINGW_VERSION 3.17 | |
20 | # undef __MINGW_MAJOR_VERSION | |
21 | # define __MINGW_MAJOR_VERSION 3 | |
22 | # undef __MINGW_MINOR_VERSION | |
23 | # define __MINGW_MINOR_VERSION 17 | |
24 | # undef __MINGW_PATCHLEVEL | |
25 | # define __MINGW_PATCHLEVEL 0 | |
26 | # endif | |
27 | #endif | |
28 | #if __MINGW_MAJOR_VERSION >= 4 | |
29 | # define _USE_32BIT_TIME_T | |
30 | #endif | |
31 | ||
32 | #endif |