config.hpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. // Copyright (C) 2001-2003
  2. // William E. Kempf
  3. // Copyright (C) 2011-2013 Vicente J. Botet Escriba
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
  8. #define BOOST_THREAD_CONFIG_WEK01032003_HPP
  9. #include <boost/config.hpp>
  10. #include <boost/detail/workaround.hpp>
  11. #include <boost/thread/detail/platform.hpp>
  12. //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
  13. // ATTRIBUTE_MAY_ALIAS
  14. #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
  15. // GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with
  16. // regard to violation of the strict aliasing rules.
  17. #define BOOST_THREAD_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
  18. #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
  19. #else
  20. #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS
  21. #endif
  22. #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
  23. #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX) \
  24. if (EXPR) {} else boost::throw_exception(EX)
  25. #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
  26. if (EXPR) {} else boost::throw_exception(EX)
  27. #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
  28. boost::throw_exception(EX)
  29. #else
  30. #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX)
  31. #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
  32. (void)(EXPR)
  33. #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
  34. return (RET)
  35. #endif
  36. // This compiler doesn't support Boost.Chrono
  37. #if defined __IBMCPP__ && (__IBMCPP__ < 1100) \
  38. && ! defined BOOST_THREAD_DONT_USE_CHRONO
  39. #define BOOST_THREAD_DONT_USE_CHRONO
  40. #if ! defined BOOST_THREAD_USES_DATETIME
  41. #define BOOST_THREAD_USES_DATETIME
  42. #endif
  43. #endif
  44. // This compiler doesn't support Boost.Move
  45. #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \
  46. && ! defined BOOST_THREAD_DONT_USE_MOVE
  47. #define BOOST_THREAD_DONT_USE_MOVE
  48. #endif
  49. // This compiler doesn't support Boost.Container Allocators files
  50. #if defined __SUNPRO_CC \
  51. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
  52. #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
  53. #endif
  54. #if defined _WIN32_WCE && _WIN32_WCE==0x501 \
  55. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
  56. #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
  57. #endif
  58. #if defined BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX || defined BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  59. #define BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
  60. #define BOOST_THREAD_NO_MAKE_LOCK_GUARD
  61. #define BOOST_THREAD_NO_MAKE_STRICT_LOCK
  62. #define BOOST_THREAD_NO_MAKE_NESTED_STRICT_LOCK
  63. #endif
  64. #if defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  65. #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
  66. #define BOOST_THREAD_NO_SYNCHRONIZE
  67. #elif defined _MSC_VER && _MSC_VER <= 1600
  68. // C++ features supported by VC++ 10 (aka 2010)
  69. #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
  70. #define BOOST_THREAD_NO_SYNCHRONIZE
  71. #endif
  72. /// BASIC_THREAD_ID
  73. #if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID \
  74. && ! defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
  75. #define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
  76. #endif
  77. /// RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR
  78. //#if defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC
  79. #define BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR
  80. //#endif
  81. // Default version
  82. #if !defined BOOST_THREAD_VERSION
  83. #define BOOST_THREAD_VERSION 2
  84. #else
  85. #if BOOST_THREAD_VERSION!=2 && BOOST_THREAD_VERSION!=3 && BOOST_THREAD_VERSION!=4
  86. #error "BOOST_THREAD_VERSION must be 2, 3 or 4"
  87. #endif
  88. #endif
  89. // CHRONO
  90. // Uses Boost.Chrono by default if not stated the opposite defining BOOST_THREAD_DONT_USE_CHRONO
  91. #if ! defined BOOST_THREAD_DONT_USE_CHRONO \
  92. && ! defined BOOST_THREAD_USES_CHRONO
  93. #define BOOST_THREAD_USES_CHRONO
  94. #endif
  95. #if ! defined BOOST_THREAD_DONT_USE_ATOMIC \
  96. && ! defined BOOST_THREAD_USES_ATOMIC
  97. #define BOOST_THREAD_USES_ATOMIC
  98. //#define BOOST_THREAD_DONT_USE_ATOMIC
  99. #endif
  100. #if defined BOOST_THREAD_USES_ATOMIC
  101. // Andrey Semashev
  102. #define BOOST_THREAD_ONCE_ATOMIC
  103. #else
  104. //#elif ! defined BOOST_NO_CXX11_THREAD_LOCAL && ! defined BOOST_NO_THREAD_LOCAL && ! defined BOOST_THREAD_NO_UINT32_PSEUDO_ATOMIC
  105. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html#Appendix
  106. #define BOOST_THREAD_ONCE_FAST_EPOCH
  107. #endif
  108. #if BOOST_THREAD_VERSION==2
  109. // PROVIDE_PROMISE_LAZY
  110. #if ! defined BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY \
  111. && ! defined BOOST_THREAD_PROVIDES_PROMISE_LAZY
  112. #define BOOST_THREAD_PROVIDES_PROMISE_LAZY
  113. #endif
  114. // PROVIDE_THREAD_EQ
  115. #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_EQ \
  116. && ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
  117. #define BOOST_THREAD_PROVIDES_THREAD_EQ
  118. #endif
  119. #endif
  120. #if BOOST_THREAD_VERSION>=3
  121. // ONCE_CXX11
  122. // fixme BOOST_THREAD_PROVIDES_ONCE_CXX11 doesn't works when thread.cpp is compiled BOOST_THREAD_VERSION 3
  123. #if ! defined BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11 \
  124. && ! defined BOOST_THREAD_PROVIDES_ONCE_CXX11
  125. #define BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11
  126. #endif
  127. // THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
  128. #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE \
  129. && ! defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
  130. #define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
  131. #endif
  132. // THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
  133. #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE \
  134. && ! defined BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
  135. #define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
  136. #endif
  137. // PROVIDE_FUTURE
  138. #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE \
  139. && ! defined BOOST_THREAD_PROVIDES_FUTURE
  140. #define BOOST_THREAD_PROVIDES_FUTURE
  141. #endif
  142. // FUTURE_CTOR_ALLOCATORS
  143. #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS \
  144. && ! defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
  145. #define BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
  146. #endif
  147. // SHARED_MUTEX_UPWARDS_CONVERSIONS
  148. #if ! defined BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSIONS \
  149. && ! defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
  150. #define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
  151. #endif
  152. // PROVIDE_EXPLICIT_LOCK_CONVERSION
  153. #if ! defined BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION \
  154. && ! defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
  155. #define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
  156. #endif
  157. // GENERIC_SHARED_MUTEX_ON_WIN
  158. #if ! defined BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN \
  159. && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
  160. #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
  161. #endif
  162. // USE_MOVE
  163. #if ! defined BOOST_THREAD_DONT_USE_MOVE \
  164. && ! defined BOOST_THREAD_USES_MOVE
  165. #define BOOST_THREAD_USES_MOVE
  166. #endif
  167. #endif
  168. // deprecated since version 4
  169. #if BOOST_THREAD_VERSION < 4
  170. // NESTED_LOCKS
  171. #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
  172. && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
  173. #define BOOST_THREAD_PROVIDES_NESTED_LOCKS
  174. #endif
  175. // CONDITION
  176. #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
  177. && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
  178. #define BOOST_THREAD_PROVIDES_CONDITION
  179. #endif
  180. // USE_DATETIME
  181. #if ! defined BOOST_THREAD_DONT_USE_DATETIME \
  182. && ! defined BOOST_THREAD_USES_DATETIME
  183. #define BOOST_THREAD_USES_DATETIME
  184. #endif
  185. #endif
  186. #if BOOST_THREAD_VERSION>=4
  187. // SIGNATURE_PACKAGED_TASK
  188. #if ! defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK \
  189. && ! defined BOOST_THREAD_DONT_PROVIDE_SIGNATURE_PACKAGED_TASK
  190. #define BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
  191. #endif
  192. // VARIADIC_THREAD
  193. #if ! defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD \
  194. && ! defined BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD
  195. #if ! defined(BOOST_NO_SFINAE_EXPR) && \
  196. ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
  197. ! defined(BOOST_NO_CXX11_DECLTYPE) && \
  198. ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
  199. ! defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) && \
  200. ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
  201. ! defined(BOOST_NO_CXX11_HDR_TUPLE)
  202. #define BOOST_THREAD_PROVIDES_VARIADIC_THREAD
  203. #endif
  204. #endif
  205. #if ! defined BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY \
  206. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_WHEN_ALL_WHEN_ANY
  207. #if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
  208. ! defined(BOOST_NO_CXX11_HDR_TUPLE)
  209. #define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
  210. #endif
  211. #endif
  212. // ! defined(BOOST_NO_SFINAE_EXPR) &&
  213. // ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) &&
  214. // ! defined(BOOST_NO_CXX11_AUTO) &&
  215. // ! defined(BOOST_NO_CXX11_DECLTYPE) &&
  216. // ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) &&
  217. // MAKE_READY_AT_THREAD_EXIT
  218. #if ! defined BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT \
  219. && ! defined BOOST_THREAD_DONT_PROVIDE_MAKE_READY_AT_THREAD_EXIT
  220. //#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
  221. #define BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT
  222. //#endif
  223. #endif
  224. // FUTURE_CONTINUATION
  225. #if ! defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \
  226. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CONTINUATION
  227. #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
  228. #endif
  229. #if ! defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP \
  230. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_UNWRAP
  231. #define BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
  232. #endif
  233. // FUTURE_INVALID_AFTER_GET
  234. #if ! defined BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET \
  235. && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
  236. #define BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET
  237. #endif
  238. // NESTED_LOCKS
  239. #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
  240. && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
  241. #define BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
  242. #endif
  243. // CONDITION
  244. #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
  245. && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
  246. #define BOOST_THREAD_DONT_PROVIDE_CONDITION
  247. #endif
  248. #endif // BOOST_THREAD_VERSION>=4
  249. // INTERRUPTIONS
  250. #if ! defined BOOST_THREAD_PROVIDES_INTERRUPTIONS \
  251. && ! defined BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
  252. #define BOOST_THREAD_PROVIDES_INTERRUPTIONS
  253. #endif
  254. // CORRELATIONS
  255. // EXPLICIT_LOCK_CONVERSION.
  256. #if defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
  257. #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION explicit
  258. #else
  259. #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION
  260. #endif
  261. // BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
  262. #if defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS \
  263. && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
  264. #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
  265. #endif
  266. // For C++11 call_once interface the compiler MUST support constexpr.
  267. // Otherwise once_flag would be initialized during dynamic initialization stage, which is not thread-safe.
  268. #if defined(BOOST_THREAD_PROVIDES_ONCE_CXX11)
  269. #if defined(BOOST_NO_CXX11_CONSTEXPR)
  270. #undef BOOST_THREAD_PROVIDES_ONCE_CXX11
  271. #endif
  272. #endif
  273. #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_DATETIME
  274. #undef BOOST_THREAD_DONT_USE_DATETIME
  275. #define BOOST_THREAD_USES_DATETIME
  276. #endif
  277. #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_CHRONO
  278. #undef BOOST_THREAD_DONT_USE_CHRONO
  279. #define BOOST_THREAD_USES_CHRONO
  280. #endif
  281. // BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
  282. // BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
  283. #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
  284. #if ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
  285. #define BOOST_THREAD_PROVIDES_THREAD_EQ
  286. #endif
  287. #endif
  288. //#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_THREAD_USES_MOVE
  289. #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
  290. #define BOOST_THREAD_FUTURE_USES_OPTIONAL
  291. #endif
  292. #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
  293. # pragma warn -8008 // Condition always true/false
  294. # pragma warn -8080 // Identifier declared but never used
  295. # pragma warn -8057 // Parameter never used
  296. # pragma warn -8066 // Unreachable code
  297. #endif
  298. #include <boost/thread/detail/platform.hpp>
  299. #if defined(BOOST_THREAD_PLATFORM_WIN32)
  300. #else
  301. # if defined(BOOST_HAS_PTHREAD_DELAY_NP) || defined(BOOST_HAS_NANOSLEEP)
  302. # define BOOST_THREAD_SLEEP_FOR_IS_STEADY
  303. # endif
  304. #endif
  305. // provided for backwards compatibility, since this
  306. // macro was used for several releases by mistake.
  307. #if defined(BOOST_THREAD_DYN_DLL) && ! defined BOOST_THREAD_DYN_LINK
  308. # define BOOST_THREAD_DYN_LINK
  309. #endif
  310. // compatibility with the rest of Boost's auto-linking code:
  311. #if defined(BOOST_THREAD_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
  312. # undef BOOST_THREAD_USE_LIB
  313. # if !defined(BOOST_THREAD_USE_DLL)
  314. # define BOOST_THREAD_USE_DLL
  315. # endif
  316. #endif
  317. #if defined(BOOST_THREAD_BUILD_DLL) //Build dll
  318. #elif defined(BOOST_THREAD_BUILD_LIB) //Build lib
  319. #elif defined(BOOST_THREAD_USE_DLL) //Use dll
  320. #elif defined(BOOST_THREAD_USE_LIB) //Use lib
  321. #else //Use default
  322. # if defined(BOOST_THREAD_PLATFORM_WIN32)
  323. # if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \
  324. || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32)
  325. //For compilers supporting auto-tss cleanup
  326. //with Boost.Threads lib, use Boost.Threads lib
  327. # define BOOST_THREAD_USE_LIB
  328. # else
  329. //For compilers not yet supporting auto-tss cleanup
  330. //with Boost.Threads lib, use Boost.Threads dll
  331. # define BOOST_THREAD_USE_DLL
  332. # endif
  333. # else
  334. # define BOOST_THREAD_USE_LIB
  335. # endif
  336. #endif
  337. #if defined(BOOST_HAS_DECLSPEC)
  338. # if defined(BOOST_THREAD_BUILD_DLL) //Build dll
  339. # define BOOST_THREAD_DECL BOOST_SYMBOL_EXPORT
  340. //# define BOOST_THREAD_DECL __declspec(dllexport)
  341. # elif defined(BOOST_THREAD_USE_DLL) //Use dll
  342. # define BOOST_THREAD_DECL BOOST_SYMBOL_IMPORT
  343. //# define BOOST_THREAD_DECL __declspec(dllimport)
  344. # else
  345. # define BOOST_THREAD_DECL
  346. # endif
  347. #elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
  348. # define BOOST_THREAD_DECL BOOST_SYMBOL_VISIBLE
  349. #else
  350. # define BOOST_THREAD_DECL
  351. #endif // BOOST_HAS_DECLSPEC
  352. //
  353. // Automatically link to the correct build variant where possible.
  354. //
  355. #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_THREAD_NO_LIB) && !defined(BOOST_THREAD_BUILD_DLL) && !defined(BOOST_THREAD_BUILD_LIB)
  356. //
  357. // Tell the autolink to link dynamically, this will get undef'ed by auto_link.hpp
  358. // once it's done with it:
  359. //
  360. #if defined(BOOST_THREAD_USE_DLL)
  361. # define BOOST_DYN_LINK
  362. #endif
  363. //
  364. // Set the name of our library, this will get undef'ed by auto_link.hpp
  365. // once it's done with it:
  366. //
  367. #if defined(BOOST_THREAD_LIB_NAME)
  368. # define BOOST_LIB_NAME BOOST_THREAD_LIB_NAME
  369. #else
  370. # define BOOST_LIB_NAME boost_thread
  371. #endif
  372. //
  373. // If we're importing code from a dll, then tell auto_link.hpp about it:
  374. //
  375. // And include the header that does the work:
  376. //
  377. #include <boost/config/auto_link.hpp>
  378. #endif // auto-linking disabled
  379. #endif // BOOST_THREAD_CONFIG_WEK1032003_HPP
  380. // Change Log:
  381. // 22 Jan 05 Roland Schwarz (speedsnail)
  382. // Usage of BOOST_HAS_DECLSPEC macro.
  383. // Default again is static lib usage.
  384. // BOOST_DYN_LINK only defined when autolink included.