mingw_time.h 994 B

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