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