1 // Copyright (C) 2001-2003
3 // Copyright (C) 2011-2013 Vicente J. Botet Escriba
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)
8 #ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
9 #define BOOST_THREAD_CONFIG_WEK01032003_HPP
11 #include <boost/config.hpp>
12 #include <boost/detail/workaround.hpp>
13 #include <boost/thread/detail/platform.hpp>
15 //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
16 // ATTRIBUTE_MAY_ALIAS
18 //#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
19 #if !defined(BOOST_NO_MAY_ALIAS)
21 // GCC since 3.3 and some other compilers have may_alias attribute that helps
22 // to alleviate optimizer issues with regard to violation of the strict aliasing rules.
24 #define BOOST_THREAD_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
26 #if defined(BOOST_MAY_ALIAS)
27 #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS BOOST_MAY_ALIAS
29 #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS
32 #if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
33 # warning Boost.Thread will use the Windows API for time
34 #elif defined(BOOST_THREAD_CHRONO_MAC_API)
35 # warning Boost.Thread will use the Mac API for time
36 #elif defined(BOOST_THREAD_CHRONO_POSIX_API)
37 # warning Boost.Thread will use the POSIX API for time
40 # if defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API )
41 # error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_POSIX_API are defined
42 # elif defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_MAC_API )
43 # error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_MAC_API are defined
44 # elif defined( BOOST_THREAD_CHRONO_MAC_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API )
45 # error both BOOST_THREAD_CHRONO_MAC_API and BOOST_THREAD_CHRONO_POSIX_API are defined
46 # elif !defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && !defined( BOOST_THREAD_CHRONO_MAC_API ) && !defined( BOOST_THREAD_CHRONO_POSIX_API )
47 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
48 # define BOOST_THREAD_CHRONO_WINDOWS_API
49 # elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
50 # define BOOST_THREAD_CHRONO_MAC_API
52 # define BOOST_THREAD_CHRONO_POSIX_API
56 #if !defined(BOOST_THREAD_POLL_INTERVAL_MILLISECONDS)
57 #define BOOST_THREAD_POLL_INTERVAL_MILLISECONDS 100
60 #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
61 #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX) \
62 if (EXPR) {} else boost::throw_exception(EX)
63 #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
64 if (EXPR) {} else boost::throw_exception(EX)
65 #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
66 boost::throw_exception(EX)
68 #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX)
69 #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \
71 #define BOOST_THREAD_THROW_ELSE_RETURN(EX, RET) \
75 // This compiler doesn't support Boost.Chrono
76 #if defined __IBMCPP__ && (__IBMCPP__ < 1100) \
77 && ! defined BOOST_THREAD_DONT_USE_CHRONO
78 #define BOOST_THREAD_DONT_USE_CHRONO
79 #if ! defined BOOST_THREAD_USES_DATETIME
80 #define BOOST_THREAD_USES_DATETIME
84 // This compiler doesn't support Boost.Move
85 #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \
86 && ! defined BOOST_THREAD_DONT_USE_MOVE
87 #define BOOST_THREAD_DONT_USE_MOVE
90 // This compiler doesn't support Boost.Container Allocators files
91 #if defined __SUNPRO_CC \
92 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
93 #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
96 #if defined _WIN32_WCE && _WIN32_WCE==0x501 \
97 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
98 #define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
102 #if defined BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX || defined BOOST_NO_CXX11_HDR_INITIALIZER_LIST
103 #define BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
104 #define BOOST_THREAD_NO_MAKE_LOCK_GUARD
105 #define BOOST_THREAD_NO_MAKE_STRICT_LOCK
106 #define BOOST_THREAD_NO_MAKE_NESTED_STRICT_LOCK
109 #if defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
110 #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
111 #define BOOST_THREAD_NO_SYNCHRONIZE
112 #elif defined _MSC_VER && _MSC_VER <= 1600
113 // C++ features supported by VC++ 10 (aka 2010)
114 #define BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS
115 #define BOOST_THREAD_NO_SYNCHRONIZE
119 #if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID \
120 && ! defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
121 #define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
124 /// RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR
125 //#if defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC
126 #define BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNCTION_PTR
130 #if !defined BOOST_THREAD_VERSION
131 #define BOOST_THREAD_VERSION 2
133 #if BOOST_THREAD_VERSION!=2 && BOOST_THREAD_VERSION!=3 && BOOST_THREAD_VERSION!=4 && BOOST_THREAD_VERSION!=5
134 #error "BOOST_THREAD_VERSION must be 2, 3, 4 or 5"
139 // Uses Boost.Chrono by default if not stated the opposite defining BOOST_THREAD_DONT_USE_CHRONO
140 #if ! defined BOOST_THREAD_DONT_USE_CHRONO \
141 && ! defined BOOST_THREAD_USES_CHRONO
142 #define BOOST_THREAD_USES_CHRONO
145 #if ! defined BOOST_THREAD_DONT_USE_ATOMIC \
146 && ! defined BOOST_THREAD_USES_ATOMIC
147 #define BOOST_THREAD_USES_ATOMIC
148 //#define BOOST_THREAD_DONT_USE_ATOMIC
151 #if defined BOOST_THREAD_USES_ATOMIC
153 #define BOOST_THREAD_ONCE_ATOMIC
155 //#elif ! defined BOOST_NO_CXX11_THREAD_LOCAL && ! defined BOOST_NO_THREAD_LOCAL && ! defined BOOST_THREAD_NO_UINT32_PSEUDO_ATOMIC
156 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html#Appendix
157 #define BOOST_THREAD_ONCE_FAST_EPOCH
159 #if BOOST_THREAD_VERSION==2
161 // PROVIDE_PROMISE_LAZY
162 #if ! defined BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY \
163 && ! defined BOOST_THREAD_PROVIDES_PROMISE_LAZY
164 #define BOOST_THREAD_PROVIDES_PROMISE_LAZY
168 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_EQ \
169 && ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
170 #define BOOST_THREAD_PROVIDES_THREAD_EQ
175 #if BOOST_THREAD_VERSION>=3
178 // fixme BOOST_THREAD_PROVIDES_ONCE_CXX11 doesn't works when thread.cpp is compiled BOOST_THREAD_VERSION 3
179 #if ! defined BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11 \
180 && ! defined BOOST_THREAD_PROVIDES_ONCE_CXX11
181 #define BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11
184 // THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
185 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE \
186 && ! defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
187 #define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
190 // THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
191 #if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE \
192 && ! defined BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
193 #define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
197 #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE \
198 && ! defined BOOST_THREAD_PROVIDES_FUTURE
199 #define BOOST_THREAD_PROVIDES_FUTURE
202 // FUTURE_CTOR_ALLOCATORS
203 #if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS \
204 && ! defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
205 #define BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
208 // SHARED_MUTEX_UPWARDS_CONVERSIONS
209 #if ! defined BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSIONS \
210 && ! defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
211 #define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
214 // PROVIDE_EXPLICIT_LOCK_CONVERSION
215 #if ! defined BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION \
216 && ! defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
217 #define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
220 // GENERIC_SHARED_MUTEX_ON_WIN
221 #if ! defined BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN \
222 && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
223 #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
227 #if ! defined BOOST_THREAD_DONT_USE_MOVE \
228 && ! defined BOOST_THREAD_USES_MOVE
229 #define BOOST_THREAD_USES_MOVE
234 // deprecated since version 4
235 #if BOOST_THREAD_VERSION < 4
238 #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
239 && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
240 #define BOOST_THREAD_PROVIDES_NESTED_LOCKS
244 #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
245 && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
246 #define BOOST_THREAD_PROVIDES_CONDITION
250 #if ! defined BOOST_THREAD_DONT_USE_DATETIME \
251 && ! defined BOOST_THREAD_USES_DATETIME
252 #define BOOST_THREAD_USES_DATETIME
256 #if BOOST_THREAD_VERSION>=4
258 // SIGNATURE_PACKAGED_TASK
259 #if ! defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK \
260 && ! defined BOOST_THREAD_DONT_PROVIDE_SIGNATURE_PACKAGED_TASK
261 #define BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
265 #if ! defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD \
266 && ! defined BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD
268 #if ! defined(BOOST_NO_SFINAE_EXPR) && \
269 ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
270 ! defined(BOOST_NO_CXX11_DECLTYPE) && \
271 ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
272 ! defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) && \
273 ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
274 ! defined(BOOST_NO_CXX11_HDR_TUPLE)
276 #define BOOST_THREAD_PROVIDES_VARIADIC_THREAD
280 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY \
281 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_WHEN_ALL_WHEN_ANY
283 #if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
284 ! defined(BOOST_NO_CXX11_HDR_TUPLE)
286 #define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
290 // ! defined(BOOST_NO_SFINAE_EXPR) &&
291 // ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) &&
292 // ! defined(BOOST_NO_CXX11_AUTO) &&
293 // ! defined(BOOST_NO_CXX11_DECLTYPE) &&
294 // ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) &&
297 // MAKE_READY_AT_THREAD_EXIT
298 #if ! defined BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT \
299 && ! defined BOOST_THREAD_DONT_PROVIDE_MAKE_READY_AT_THREAD_EXIT
301 //#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
302 #define BOOST_THREAD_PROVIDES_MAKE_READY_AT_THREAD_EXIT
306 // FUTURE_CONTINUATION
307 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \
308 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CONTINUATION
309 #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
312 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP \
313 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_UNWRAP
314 #define BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
317 // FUTURE_INVALID_AFTER_GET
318 #if ! defined BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET \
319 && ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET
320 #define BOOST_THREAD_PROVIDES_FUTURE_INVALID_AFTER_GET
324 #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS \
325 && ! defined BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
326 #define BOOST_THREAD_DONT_PROVIDE_NESTED_LOCKS
330 #if ! defined BOOST_THREAD_PROVIDES_CONDITION \
331 && ! defined BOOST_THREAD_DONT_PROVIDE_CONDITION
332 #define BOOST_THREAD_DONT_PROVIDE_CONDITION
335 #endif // BOOST_THREAD_VERSION>=4
338 #if BOOST_THREAD_VERSION>=5
339 //#define BOOST_THREAD_FUTURE_BLOCKING
341 //#define BOOST_THREAD_FUTURE_BLOCKING
342 #define BOOST_THREAD_ASYNC_FUTURE_WAITS
345 #if ! defined BOOST_THREAD_PROVIDES_INTERRUPTIONS \
346 && ! defined BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
347 #define BOOST_THREAD_PROVIDES_INTERRUPTIONS
352 // EXPLICIT_LOCK_CONVERSION.
353 #if defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
354 #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION explicit
356 #define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION
359 // BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
360 #if defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS \
361 && ! defined BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
362 #define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
365 // For C++11 call_once interface the compiler MUST support constexpr.
366 // Otherwise once_flag would be initialized during dynamic initialization stage, which is not thread-safe.
367 #if defined(BOOST_THREAD_PROVIDES_ONCE_CXX11)
368 #if defined(BOOST_NO_CXX11_CONSTEXPR)
369 #undef BOOST_THREAD_PROVIDES_ONCE_CXX11
373 #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_DATETIME
374 #undef BOOST_THREAD_DONT_USE_DATETIME
375 #define BOOST_THREAD_USES_DATETIME
378 #if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_CHRONO
379 #undef BOOST_THREAD_DONT_USE_CHRONO
380 #define BOOST_THREAD_USES_CHRONO
383 // BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
384 // BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
385 #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
387 #if ! defined BOOST_THREAD_PROVIDES_THREAD_EQ
388 #define BOOST_THREAD_PROVIDES_THREAD_EQ
394 //#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_THREAD_USES_MOVE
395 #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
396 #define BOOST_THREAD_FUTURE_USES_OPTIONAL
399 #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
400 # pragma warn -8008 // Condition always true/false
401 # pragma warn -8080 // Identifier declared but never used
402 # pragma warn -8057 // Parameter never used
403 # pragma warn -8066 // Unreachable code
406 #include <boost/thread/detail/platform.hpp>
408 #if defined(BOOST_THREAD_PLATFORM_WIN32)
410 # if defined(BOOST_HAS_PTHREAD_DELAY_NP) || defined(BOOST_HAS_NANOSLEEP)
411 # define BOOST_THREAD_SLEEP_FOR_IS_STEADY
415 #if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
416 #define BOOST_THREAD_HAS_MONO_CLOCK
417 #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
418 #elif defined(BOOST_THREAD_CHRONO_MAC_API)
419 #define BOOST_THREAD_HAS_MONO_CLOCK
421 #include <time.h> // check for CLOCK_MONOTONIC
422 #if defined(CLOCK_MONOTONIC)
423 #define BOOST_THREAD_HAS_MONO_CLOCK
424 #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
428 #if defined(BOOST_THREAD_PLATFORM_WIN32)
429 #elif ! defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO
430 #if defined BOOST_PTHREAD_HAS_TIMEDLOCK
431 #define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK
432 #elif (defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS-0)>=200112L) \
433 || (defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__ >= 21)
434 #define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK
438 // provided for backwards compatibility, since this
439 // macro was used for several releases by mistake.
440 #if defined(BOOST_THREAD_DYN_DLL) && ! defined(BOOST_THREAD_DYN_LINK)
441 # define BOOST_THREAD_DYN_LINK
444 // compatibility with the rest of Boost's auto-linking code:
445 #if defined(BOOST_THREAD_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
446 # undef BOOST_THREAD_USE_LIB
447 # if !defined(BOOST_THREAD_USE_DLL)
448 # define BOOST_THREAD_USE_DLL
452 #if defined(BOOST_THREAD_BUILD_DLL) //Build dll
453 #elif defined(BOOST_THREAD_BUILD_LIB) //Build lib
454 #elif defined(BOOST_THREAD_USE_DLL) //Use dll
455 #elif defined(BOOST_THREAD_USE_LIB) //Use lib
457 # if defined(BOOST_THREAD_PLATFORM_WIN32)
458 # if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \
459 || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32)
460 //For compilers supporting auto-tss cleanup
461 //with Boost.Threads lib, use Boost.Threads lib
462 # define BOOST_THREAD_USE_LIB
464 //For compilers not yet supporting auto-tss cleanup
465 //with Boost.Threads lib, use Boost.Threads dll
466 # define BOOST_THREAD_USE_DLL
469 # define BOOST_THREAD_USE_LIB
473 #if defined(BOOST_HAS_DECLSPEC)
474 # if defined(BOOST_THREAD_BUILD_DLL) //Build dll
475 # define BOOST_THREAD_DECL BOOST_SYMBOL_EXPORT
476 //# define BOOST_THREAD_DECL __declspec(dllexport)
478 # elif defined(BOOST_THREAD_USE_DLL) //Use dll
479 # define BOOST_THREAD_DECL BOOST_SYMBOL_IMPORT
480 //# define BOOST_THREAD_DECL __declspec(dllimport)
482 # define BOOST_THREAD_DECL
484 #elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
485 # define BOOST_THREAD_DECL BOOST_SYMBOL_VISIBLE
488 # define BOOST_THREAD_DECL
489 #endif // BOOST_HAS_DECLSPEC
492 // Automatically link to the correct build variant where possible.
494 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_THREAD_NO_LIB) && !defined(BOOST_THREAD_BUILD_DLL) && !defined(BOOST_THREAD_BUILD_LIB)
496 // Tell the autolink to link dynamically, this will get undef'ed by auto_link.hpp
497 // once it's done with it:
499 #if defined(BOOST_THREAD_USE_DLL) & ! defined(BOOST_DYN_LINK)
500 # define BOOST_DYN_LINK
503 // Set the name of our library, this will get undef'ed by auto_link.hpp
504 // once it's done with it:
506 #if defined(BOOST_THREAD_LIB_NAME)
507 # define BOOST_LIB_NAME BOOST_THREAD_LIB_NAME
509 # define BOOST_LIB_NAME boost_thread
512 // If we're importing code from a dll, then tell auto_link.hpp about it:
514 // And include the header that does the work:
516 #include <boost/config/auto_link.hpp>
517 #endif // auto-linking disabled
519 #endif // BOOST_THREAD_CONFIG_WEK1032003_HPP
522 // 22 Jan 05 Roland Schwarz (speedsnail)
523 // Usage of BOOST_HAS_DECLSPEC macro.
524 // Default again is static lib usage.
525 // BOOST_DYN_LINK only defined when autolink included.