config.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* config.h */
  2. #ifndef PTW32_CONFIG_H
  3. #define PTW32_CONFIG_H
  4. /*********************************************************************
  5. * Defaults: see target specific redefinitions below.
  6. *********************************************************************/
  7. /* We're building the pthreads-win32 library */
  8. #define PTW32_BUILD
  9. /* Do we know about the C type sigset_t? */
  10. #undef HAVE_SIGSET_T
  11. /* Define if you have the <signal.h> header file. */
  12. #undef HAVE_SIGNAL_H
  13. /* Define if you have the Borland TASM32 or compatible assembler. */
  14. #undef HAVE_TASM32
  15. /* Define if you don't have Win32 DuplicateHandle. (eg. WinCE) */
  16. #undef NEED_DUPLICATEHANDLE
  17. /* Define if you don't have Win32 _beginthreadex. (eg. WinCE) */
  18. #undef NEED_CREATETHREAD
  19. /* Define if you don't have Win32 errno. (eg. WinCE) */
  20. #undef NEED_ERRNO
  21. /* Define if you don't have Win32 calloc. (eg. WinCE) */
  22. #undef NEED_CALLOC
  23. /* Define if you don't have Win32 ftime. (eg. WinCE) */
  24. #undef NEED_FTIME
  25. /* Define if you don't have Win32 semaphores. (eg. WinCE 2.1 or earlier) */
  26. #undef NEED_SEM
  27. /* Define if you need to convert string parameters to unicode. (eg. WinCE) */
  28. #undef NEED_UNICODE_CONSTS
  29. /* Define if your C (not C++) compiler supports "inline" functions. */
  30. #undef HAVE_C_INLINE
  31. /* Do we know about type mode_t? */
  32. #undef HAVE_MODE_T
  33. /*
  34. * Define if GCC has atomic builtins, i.e. __sync_* intrinsics
  35. * __sync_lock_* is implemented in mingw32 gcc 4.5.2 at least
  36. * so this define does not turn those on or off. If you get an
  37. * error from __sync_lock* then consider upgrading your gcc.
  38. */
  39. #undef HAVE_GCC_ATOMIC_BUILTINS
  40. /* Define if you have the timespec struct */
  41. #undef HAVE_STRUCT_TIMESPEC
  42. #if _MSC_VER >= 1900
  43. #define HAVE_STRUCT_TIMESPEC
  44. #endif
  45. /* Define if you don't have the GetProcessAffinityMask() */
  46. #undef NEED_PROCESS_AFFINITY_MASK
  47. /* Define if your version of Windows TLSGetValue() clears WSALastError
  48. * and calling SetLastError() isn't enough restore it. You'll also need to
  49. * link against wsock32.lib (or libwsock32.a for MinGW).
  50. */
  51. #undef RETAIN_WSALASTERROR
  52. /*
  53. # ----------------------------------------------------------------------
  54. # The library can be built with some alternative behaviour to better
  55. # facilitate development of applications on Win32 that will be ported
  56. # to other POSIX systems.
  57. #
  58. # Nothing described here will make the library non-compliant and strictly
  59. # compliant applications will not be affected in any way, but
  60. # applications that make assumptions that POSIX does not guarantee are
  61. # not strictly compliant and may fail or misbehave with some settings.
  62. #
  63. # PTW32_THREAD_ID_REUSE_INCREMENT
  64. # Purpose:
  65. # POSIX says that applications should assume that thread IDs can be
  66. # recycled. However, Solaris (and some other systems) use a [very large]
  67. # sequence number as the thread ID, which provides virtual uniqueness.
  68. # This provides a very high but finite level of safety for applications
  69. # that are not meticulous in tracking thread lifecycles e.g. applications
  70. # that call functions which target detached threads without some form of
  71. # thread exit synchronisation.
  72. #
  73. # Usage:
  74. # Set to any value in the range: 0 <= value < 2^wordsize.
  75. # Set to 0 to emulate reusable thread ID behaviour like Linux or *BSD.
  76. # Set to 1 for unique thread IDs like Solaris (this is the default).
  77. # Set to some factor of 2^wordsize to emulate smaller word size types
  78. # (i.e. will wrap sooner). This might be useful to emulate some embedded
  79. # systems.
  80. #
  81. # define PTW32_THREAD_ID_REUSE_INCREMENT 0
  82. #
  83. # ----------------------------------------------------------------------
  84. */
  85. #undef PTW32_THREAD_ID_REUSE_INCREMENT
  86. /*********************************************************************
  87. * Target specific groups
  88. *
  89. * If you find that these are incorrect or incomplete please report it
  90. * to the pthreads-win32 maintainer. Thanks.
  91. *********************************************************************/
  92. #if defined(WINCE)
  93. #define NEED_DUPLICATEHANDLE
  94. #define NEED_CREATETHREAD
  95. #define NEED_ERRNO
  96. #define NEED_CALLOC
  97. #define NEED_FTIME
  98. /* #define NEED_SEM */
  99. #define NEED_UNICODE_CONSTS
  100. #define NEED_PROCESS_AFFINITY_MASK
  101. /* This may not be needed */
  102. #define RETAIN_WSALASTERROR
  103. #endif
  104. #if defined(_UWIN)
  105. #define HAVE_MODE_T
  106. #define HAVE_STRUCT_TIMESPEC
  107. #endif
  108. #if defined(__GNUC__)
  109. #define HAVE_C_INLINE
  110. #endif
  111. #if defined(__MINGW64__)
  112. #define HAVE_MODE_T
  113. #define HAVE_STRUCT_TIMESPEC
  114. #elif defined(__MINGW32__)
  115. #define HAVE_MODE_T
  116. #endif
  117. #if defined(__BORLANDC__)
  118. #endif
  119. #if defined(__WATCOMC__)
  120. #endif
  121. #if defined(__DMC__)
  122. #define HAVE_SIGNAL_H
  123. #define HAVE_C_INLINE
  124. #endif
  125. #endif