config.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. /* Define if you don't have the GetProcessAffinityMask() */
  43. #undef NEED_PROCESS_AFFINITY_MASK
  44. /* Define if your version of Windows TLSGetValue() clears WSALastError
  45. * and calling SetLastError() isn't enough restore it. You'll also need to
  46. * link against wsock32.lib (or libwsock32.a for MinGW).
  47. */
  48. #undef RETAIN_WSALASTERROR
  49. /*
  50. # ----------------------------------------------------------------------
  51. # The library can be built with some alternative behaviour to better
  52. # facilitate development of applications on Win32 that will be ported
  53. # to other POSIX systems.
  54. #
  55. # Nothing described here will make the library non-compliant and strictly
  56. # compliant applications will not be affected in any way, but
  57. # applications that make assumptions that POSIX does not guarantee are
  58. # not strictly compliant and may fail or misbehave with some settings.
  59. #
  60. # PTW32_THREAD_ID_REUSE_INCREMENT
  61. # Purpose:
  62. # POSIX says that applications should assume that thread IDs can be
  63. # recycled. However, Solaris (and some other systems) use a [very large]
  64. # sequence number as the thread ID, which provides virtual uniqueness.
  65. # This provides a very high but finite level of safety for applications
  66. # that are not meticulous in tracking thread lifecycles e.g. applications
  67. # that call functions which target detached threads without some form of
  68. # thread exit synchronisation.
  69. #
  70. # Usage:
  71. # Set to any value in the range: 0 <= value < 2^wordsize.
  72. # Set to 0 to emulate reusable thread ID behaviour like Linux or *BSD.
  73. # Set to 1 for unique thread IDs like Solaris (this is the default).
  74. # Set to some factor of 2^wordsize to emulate smaller word size types
  75. # (i.e. will wrap sooner). This might be useful to emulate some embedded
  76. # systems.
  77. #
  78. # define PTW32_THREAD_ID_REUSE_INCREMENT 0
  79. #
  80. # ----------------------------------------------------------------------
  81. */
  82. #undef PTW32_THREAD_ID_REUSE_INCREMENT
  83. /*********************************************************************
  84. * Target specific groups
  85. *
  86. * If you find that these are incorrect or incomplete please report it
  87. * to the pthreads-win32 maintainer. Thanks.
  88. *********************************************************************/
  89. #if defined(WINCE)
  90. #define NEED_DUPLICATEHANDLE
  91. #define NEED_CREATETHREAD
  92. #define NEED_ERRNO
  93. #define NEED_CALLOC
  94. #define NEED_FTIME
  95. /* #define NEED_SEM */
  96. #define NEED_UNICODE_CONSTS
  97. #define NEED_PROCESS_AFFINITY_MASK
  98. /* This may not be needed */
  99. #define RETAIN_WSALASTERROR
  100. #endif
  101. #if defined(_UWIN)
  102. #define HAVE_MODE_T
  103. #define HAVE_STRUCT_TIMESPEC
  104. #endif
  105. #if defined(__GNUC__)
  106. #define HAVE_C_INLINE
  107. #endif
  108. #if defined(__MINGW64__)
  109. #define HAVE_MODE_T
  110. #define HAVE_STRUCT_TIMESPEC
  111. #elif defined(__MINGW32__)
  112. #define HAVE_MODE_T
  113. #endif
  114. #if defined(__BORLANDC__)
  115. #endif
  116. #if defined(__WATCOMC__)
  117. #endif
  118. #if defined(__DMC__)
  119. #define HAVE_SIGNAL_H
  120. #define HAVE_C_INLINE
  121. #endif
  122. #endif