1 | /* |
2 | Copyright (c) 2005-2021 Intel Corporation |
3 | |
4 | Licensed under the Apache License, Version 2.0 (the "License"); |
5 | you may not use this file except in compliance with the License. |
6 | You may obtain a copy of the License at |
7 | |
8 | http://www.apache.org/licenses/LICENSE-2.0 |
9 | |
10 | Unless required by applicable law or agreed to in writing, software |
11 | distributed under the License is distributed on an "AS IS" BASIS, |
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | See the License for the specific language governing permissions and |
14 | limitations under the License. |
15 | */ |
16 | |
17 | #ifndef __TBB_detail__config_H |
18 | #define __TBB_detail__config_H |
19 | |
20 | /** This header is supposed to contain macro definitions only. |
21 | The macros defined here are intended to control such aspects of TBB build as |
22 | - presence of compiler features |
23 | - compilation modes |
24 | - feature sets |
25 | - known compiler/platform issues |
26 | **/ |
27 | |
28 | /* Check which standard library we use. */ |
29 | #include <cstddef> |
30 | |
31 | #include "_export.h" |
32 | |
33 | #if _MSC_VER |
34 | #define __TBB_EXPORTED_FUNC __cdecl |
35 | #define __TBB_EXPORTED_METHOD __thiscall |
36 | #else |
37 | #define __TBB_EXPORTED_FUNC |
38 | #define __TBB_EXPORTED_METHOD |
39 | #endif |
40 | |
41 | #if defined(_MSVC_LANG) |
42 | #define __TBB_LANG _MSVC_LANG |
43 | #else |
44 | #define __TBB_LANG __cplusplus |
45 | #endif // _MSVC_LANG |
46 | |
47 | #define __TBB_CPP14_PRESENT (__TBB_LANG >= 201402L) |
48 | #define __TBB_CPP17_PRESENT (__TBB_LANG >= 201703L) |
49 | #define __TBB_CPP20_PRESENT (__TBB_LANG >= 202002L) |
50 | |
51 | #if __INTEL_COMPILER || _MSC_VER |
52 | #define __TBB_NOINLINE(decl) __declspec(noinline) decl |
53 | #elif __GNUC__ |
54 | #define __TBB_NOINLINE(decl) decl __attribute__ ((noinline)) |
55 | #else |
56 | #define __TBB_NOINLINE(decl) decl |
57 | #endif |
58 | |
59 | #define __TBB_STRING_AUX(x) #x |
60 | #define __TBB_STRING(x) __TBB_STRING_AUX(x) |
61 | |
62 | // Note that when ICC or Clang is in use, __TBB_GCC_VERSION might not fully match |
63 | // the actual GCC version on the system. |
64 | #define __TBB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
65 | |
66 | /* Check which standard library we use. */ |
67 | |
68 | // Prior to GCC 7, GNU libstdc++ did not have a convenient version macro. |
69 | // Therefore we use different ways to detect its version. |
70 | #ifdef TBB_USE_GLIBCXX_VERSION |
71 | // The version is explicitly specified in our public TBB_USE_GLIBCXX_VERSION macro. |
72 | // Its format should match the __TBB_GCC_VERSION above, e.g. 70301 for libstdc++ coming with GCC 7.3.1. |
73 | #define __TBB_GLIBCXX_VERSION TBB_USE_GLIBCXX_VERSION |
74 | #elif _GLIBCXX_RELEASE && _GLIBCXX_RELEASE != __GNUC__ |
75 | // Reported versions of GCC and libstdc++ do not match; trust the latter |
76 | #define __TBB_GLIBCXX_VERSION (_GLIBCXX_RELEASE*10000) |
77 | #elif __GLIBCPP__ || __GLIBCXX__ |
78 | // The version macro is not defined or matches the GCC version; use __TBB_GCC_VERSION |
79 | #define __TBB_GLIBCXX_VERSION __TBB_GCC_VERSION |
80 | #endif |
81 | |
82 | #if __clang__ |
83 | // according to clang documentation, version can be vendor specific |
84 | #define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) |
85 | #endif |
86 | |
87 | /** Macro helpers **/ |
88 | |
89 | #define __TBB_CONCAT_AUX(A,B) A##B |
90 | // The additional level of indirection is needed to expand macros A and B (not to get the AB macro). |
91 | // See [cpp.subst] and [cpp.concat] for more details. |
92 | #define __TBB_CONCAT(A,B) __TBB_CONCAT_AUX(A,B) |
93 | // The IGNORED argument and comma are needed to always have 2 arguments (even when A is empty). |
94 | #define __TBB_IS_MACRO_EMPTY(A,IGNORED) __TBB_CONCAT_AUX(__TBB_MACRO_EMPTY,A) |
95 | #define __TBB_MACRO_EMPTY 1 |
96 | |
97 | #if _M_X64 || _M_ARM64 |
98 | #define __TBB_W(name) name##64 |
99 | #else |
100 | #define __TBB_W(name) name |
101 | #endif |
102 | |
103 | /** User controlled TBB features & modes **/ |
104 | |
105 | #ifndef TBB_USE_DEBUG |
106 | /* |
107 | There are four cases that are supported: |
108 | 1. "_DEBUG is undefined" means "no debug"; |
109 | 2. "_DEBUG defined to something that is evaluated to 0" (including "garbage", as per [cpp.cond]) means "no debug"; |
110 | 3. "_DEBUG defined to something that is evaluated to a non-zero value" means "debug"; |
111 | 4. "_DEBUG defined to nothing (empty)" means "debug". |
112 | */ |
113 | #ifdef _DEBUG |
114 | // Check if _DEBUG is empty. |
115 | #define __TBB_IS__DEBUG_EMPTY (__TBB_IS_MACRO_EMPTY(_DEBUG,IGNORED)==__TBB_MACRO_EMPTY) |
116 | #if __TBB_IS__DEBUG_EMPTY |
117 | #define TBB_USE_DEBUG 1 |
118 | #else |
119 | #define TBB_USE_DEBUG _DEBUG |
120 | #endif // __TBB_IS__DEBUG_EMPTY |
121 | #else |
122 | #define TBB_USE_DEBUG 0 |
123 | #endif // _DEBUG |
124 | #endif // TBB_USE_DEBUG |
125 | |
126 | #ifndef TBB_USE_ASSERT |
127 | #define TBB_USE_ASSERT TBB_USE_DEBUG |
128 | #endif // TBB_USE_ASSERT |
129 | |
130 | #ifndef TBB_USE_PROFILING_TOOLS |
131 | #if TBB_USE_DEBUG |
132 | #define TBB_USE_PROFILING_TOOLS 2 |
133 | #else // TBB_USE_DEBUG |
134 | #define TBB_USE_PROFILING_TOOLS 0 |
135 | #endif // TBB_USE_DEBUG |
136 | #endif // TBB_USE_PROFILING_TOOLS |
137 | |
138 | // Exceptions support cases |
139 | #if !(__EXCEPTIONS || defined(_CPPUNWIND) || __SUNPRO_CC) |
140 | #if TBB_USE_EXCEPTIONS |
141 | #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0. |
142 | #elif !defined(TBB_USE_EXCEPTIONS) |
143 | #define TBB_USE_EXCEPTIONS 0 |
144 | #endif |
145 | #elif !defined(TBB_USE_EXCEPTIONS) |
146 | #define TBB_USE_EXCEPTIONS 1 |
147 | #endif |
148 | |
149 | /** Preprocessor symbols to determine HW architecture **/ |
150 | |
151 | #if _WIN32 || _WIN64 |
152 | #if defined(_M_X64) || defined(__x86_64__) // the latter for MinGW support |
153 | #define __TBB_x86_64 1 |
154 | #elif defined(_M_IA64) |
155 | #define __TBB_ipf 1 |
156 | #elif defined(_M_IX86) || defined(__i386__) // the latter for MinGW support |
157 | #define __TBB_x86_32 1 |
158 | #else |
159 | #define __TBB_generic_arch 1 |
160 | #endif |
161 | #else /* Assume generic Unix */ |
162 | #if __x86_64__ |
163 | #define __TBB_x86_64 1 |
164 | #elif __ia64__ |
165 | #define __TBB_ipf 1 |
166 | #elif __i386__||__i386 // __i386 is for Sun OS |
167 | #define __TBB_x86_32 1 |
168 | #else |
169 | #define __TBB_generic_arch 1 |
170 | #endif |
171 | #endif |
172 | |
173 | /** Windows API or POSIX API **/ |
174 | |
175 | #if _WIN32 || _WIN64 |
176 | #define __TBB_USE_WINAPI 1 |
177 | #else |
178 | #define __TBB_USE_POSIX 1 |
179 | #endif |
180 | |
181 | /** Internal TBB features & modes **/ |
182 | |
183 | /** __TBB_DYNAMIC_LOAD_ENABLED describes the system possibility to load shared libraries at run time **/ |
184 | #ifndef __TBB_DYNAMIC_LOAD_ENABLED |
185 | #define __TBB_DYNAMIC_LOAD_ENABLED 1 |
186 | #endif |
187 | |
188 | /** __TBB_WIN8UI_SUPPORT enables support of Windows* Store Apps and limit a possibility to load |
189 | shared libraries at run time only from application container **/ |
190 | #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP |
191 | #define __TBB_WIN8UI_SUPPORT 1 |
192 | #else |
193 | #define __TBB_WIN8UI_SUPPORT 0 |
194 | #endif |
195 | |
196 | /** __TBB_WEAK_SYMBOLS_PRESENT denotes that the system supports the weak symbol mechanism **/ |
197 | #ifndef __TBB_WEAK_SYMBOLS_PRESENT |
198 | #define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) ) |
199 | #endif |
200 | |
201 | /** Presence of compiler features **/ |
202 | |
203 | #if __clang__ && !__INTEL_COMPILER |
204 | #define __TBB_USE_OPTIONAL_RTTI __has_feature(cxx_rtti) |
205 | #elif defined(_CPPRTTI) |
206 | #define __TBB_USE_OPTIONAL_RTTI 1 |
207 | #else |
208 | #define __TBB_USE_OPTIONAL_RTTI (__GXX_RTTI || __RTTI || __INTEL_RTTI__) |
209 | #endif |
210 | |
211 | /** Address sanitizer detection **/ |
212 | #ifdef __SANITIZE_ADDRESS__ |
213 | #define __TBB_USE_ADDRESS_SANITIZER 1 |
214 | #elif defined(__has_feature) |
215 | #if __has_feature(address_sanitizer) |
216 | #define __TBB_USE_ADDRESS_SANITIZER 1 |
217 | #endif |
218 | #endif |
219 | |
220 | /** Library features presence macros **/ |
221 | |
222 | #define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__TBB_LANG >= 201402L) |
223 | #define __TBB_CPP17_INVOKE_RESULT_PRESENT (__TBB_LANG >= 201703L) |
224 | |
225 | // TODO: Remove the condition(__INTEL_COMPILER > 2021) from the __TBB_CPP17_DEDUCTION_GUIDES_PRESENT |
226 | // macro when this feature start working correctly on this compiler. |
227 | #if __INTEL_COMPILER && (!_MSC_VER || __INTEL_CXX11_MOVE__) |
228 | #define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__TBB_LANG >= 201402L) |
229 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__INTEL_COMPILER > 2021 && __TBB_LANG >= 201703L) |
230 | #define __TBB_CPP20_CONCEPTS_PRESENT 0 // TODO: add a mechanism for future addition |
231 | #elif __clang__ |
232 | #define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__has_feature(cxx_variable_templates)) |
233 | #define __TBB_CPP20_CONCEPTS_PRESENT 0 // TODO: add a mechanism for future addition |
234 | #ifdef __cpp_deduction_guides |
235 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__cpp_deduction_guides >= 201611L) |
236 | #else |
237 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 0 |
238 | #endif |
239 | #elif __GNUC__ |
240 | #define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__TBB_LANG >= 201402L && __TBB_GCC_VERSION >= 50000) |
241 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__cpp_deduction_guides >= 201606L) |
242 | #define __TBB_CPP20_CONCEPTS_PRESENT (__TBB_LANG >= 201709L && __TBB_GCC_VERSION >= 100201) |
243 | #elif _MSC_VER |
244 | #define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (_MSC_FULL_VER >= 190023918 && (!__INTEL_COMPILER || __INTEL_COMPILER >= 1700)) |
245 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (_MSC_VER >= 1914 && __TBB_LANG >= 201703L && (!__INTEL_COMPILER || __INTEL_COMPILER > 2021)) |
246 | #define __TBB_CPP20_CONCEPTS_PRESENT (_MSC_VER >= 1923 && __TBB_LANG >= 202002L) // TODO: INTEL_COMPILER? |
247 | #else |
248 | #define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__TBB_LANG >= 201402L) |
249 | #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__TBB_LANG >= 201703L) |
250 | #define __TBB_CPP20_CONCEPTS_PRESENT (__TBB_LANG >= 202002L) |
251 | #endif |
252 | |
253 | // GCC4.8 on RHEL7 does not support std::get_new_handler |
254 | #define __TBB_CPP11_GET_NEW_HANDLER_PRESENT (_MSC_VER >= 1900 || __TBB_GLIBCXX_VERSION >= 40900 && __GXX_EXPERIMENTAL_CXX0X__ || _LIBCPP_VERSION) |
255 | // GCC4.8 on RHEL7 does not support std::is_trivially_copyable |
256 | #define __TBB_CPP11_TYPE_PROPERTIES_PRESENT (_LIBCPP_VERSION || _MSC_VER >= 1700 || (__TBB_GLIBCXX_VERSION >= 50000 && __GXX_EXPERIMENTAL_CXX0X__)) |
257 | |
258 | #define __TBB_CPP17_MEMORY_RESOURCE_PRESENT (_MSC_VER >= 1913 && (__TBB_LANG > 201402L) || \ |
259 | __TBB_GLIBCXX_VERSION >= 90000 && __TBB_LANG >= 201703L) |
260 | #define __TBB_CPP17_HW_INTERFERENCE_SIZE_PRESENT (_MSC_VER >= 1911) |
261 | #define __TBB_CPP17_LOGICAL_OPERATIONS_PRESENT (__TBB_LANG >= 201703L) |
262 | #define __TBB_CPP17_ALLOCATOR_IS_ALWAYS_EQUAL_PRESENT (__TBB_LANG >= 201703L) |
263 | #define __TBB_CPP17_IS_SWAPPABLE_PRESENT (__TBB_LANG >= 201703L) |
264 | |
265 | #if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_three_way_comparison) |
266 | #define __TBB_CPP20_COMPARISONS_PRESENT ((__cpp_impl_three_way_comparison >= 201907L) && (__cpp_lib_three_way_comparison >= 201907L)) |
267 | #else |
268 | #define __TBB_CPP20_COMPARISONS_PRESENT __TBB_CPP20_PRESENT |
269 | #endif |
270 | |
271 | #define __TBB_RESUMABLE_TASKS (!__TBB_WIN8UI_SUPPORT && !__ANDROID__ && !__QNXNTO__) |
272 | |
273 | /* This macro marks incomplete code or comments describing ideas which are considered for the future. |
274 | * See also for plain comment with TODO and FIXME marks for small improvement opportunities. |
275 | */ |
276 | #define __TBB_TODO 0 |
277 | |
278 | /* Check which standard library we use. */ |
279 | /* __TBB_SYMBOL is defined only while processing exported symbols list where C++ is not allowed. */ |
280 | #if !defined(__TBB_SYMBOL) && !__TBB_CONFIG_PREPROC_ONLY |
281 | #include <cstddef> |
282 | #endif |
283 | |
284 | /** Target OS is either iOS* or iOS* simulator **/ |
285 | #if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ |
286 | #define __TBB_IOS 1 |
287 | #endif |
288 | |
289 | #if __APPLE__ |
290 | #if __INTEL_COMPILER && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1099 \ |
291 | && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000 |
292 | // ICC does not correctly set the macro if -mmacosx-min-version is not specified |
293 | #define __TBB_MACOS_TARGET_VERSION (100000 + 10*(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 1000)) |
294 | #else |
295 | #define __TBB_MACOS_TARGET_VERSION __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ |
296 | #endif |
297 | #endif |
298 | |
299 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) |
300 | #define __TBB_GCC_WARNING_IGNORED_ATTRIBUTES_PRESENT (__TBB_GCC_VERSION >= 60100) |
301 | #endif |
302 | |
303 | #if __GNUC__ && !__INTEL_COMPILER && !__clang__ |
304 | #define __TBB_GCC_PARAMETER_PACK_IN_LAMBDAS_BROKEN (__TBB_GCC_VERSION <= 40805) |
305 | #endif |
306 | |
307 | #define __TBB_CPP17_FALLTHROUGH_PRESENT (__TBB_LANG >= 201703L) |
308 | #define __TBB_CPP17_NODISCARD_PRESENT (__TBB_LANG >= 201703L) |
309 | #define __TBB_FALLTHROUGH_PRESENT (__TBB_GCC_VERSION >= 70000 && !__INTEL_COMPILER) |
310 | |
311 | #if __TBB_CPP17_FALLTHROUGH_PRESENT |
312 | #define __TBB_fallthrough [[fallthrough]] |
313 | #elif __TBB_FALLTHROUGH_PRESENT |
314 | #define __TBB_fallthrough __attribute__ ((fallthrough)) |
315 | #else |
316 | #define __TBB_fallthrough |
317 | #endif |
318 | |
319 | #if __TBB_CPP17_NODISCARD_PRESENT |
320 | #define __TBB_nodiscard [[nodiscard]] |
321 | #elif __clang__ || __GNUC__ |
322 | #define __TBB_nodiscard __attribute__((warn_unused_result)) |
323 | #else |
324 | #define __TBB_nodiscard |
325 | #endif |
326 | |
327 | #define __TBB_CPP17_UNCAUGHT_EXCEPTIONS_PRESENT (_MSC_VER >= 1900 || __GLIBCXX__ && __cpp_lib_uncaught_exceptions \ |
328 | || _LIBCPP_VERSION >= 3700 && (!__TBB_MACOS_TARGET_VERSION || __TBB_MACOS_TARGET_VERSION >= 101200)) |
329 | |
330 | #define __TBB_TSX_INTRINSICS_PRESENT (__RTM__ || __INTEL_COMPILER || (_MSC_VER>=1700 && (__TBB_x86_64 || __TBB_x86_32))) |
331 | |
332 | #define __TBB_WAITPKG_INTRINSICS_PRESENT ((__INTEL_COMPILER >= 1900 || __TBB_GCC_VERSION >= 110000 || __TBB_CLANG_VERSION >= 120000) && !__ANDROID__) |
333 | |
334 | /** Internal TBB features & modes **/ |
335 | |
336 | /** __TBB_SOURCE_DIRECTLY_INCLUDED is a mode used in whitebox testing when |
337 | it's necessary to test internal functions not exported from TBB DLLs |
338 | **/ |
339 | #if (_WIN32||_WIN64) && (__TBB_SOURCE_DIRECTLY_INCLUDED || TBB_USE_PREVIEW_BINARY) |
340 | #define __TBB_NO_IMPLICIT_LINKAGE 1 |
341 | #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1 |
342 | #endif |
343 | |
344 | #if (__TBB_BUILD || __TBBMALLOC_BUILD || __TBBMALLOCPROXY_BUILD || __TBBBIND_BUILD) && !defined(__TBB_NO_IMPLICIT_LINKAGE) |
345 | #define __TBB_NO_IMPLICIT_LINKAGE 1 |
346 | #endif |
347 | |
348 | #if _MSC_VER |
349 | #if !__TBB_NO_IMPLICIT_LINKAGE |
350 | #ifdef _DEBUG |
351 | #pragma comment(lib, "tbb12_debug.lib") |
352 | #else |
353 | #pragma comment(lib, "tbb12.lib") |
354 | #endif |
355 | #endif |
356 | #endif |
357 | |
358 | #ifndef __TBB_SCHEDULER_OBSERVER |
359 | #define __TBB_SCHEDULER_OBSERVER 1 |
360 | #endif /* __TBB_SCHEDULER_OBSERVER */ |
361 | |
362 | #ifndef __TBB_FP_CONTEXT |
363 | #define __TBB_FP_CONTEXT 1 |
364 | #endif /* __TBB_FP_CONTEXT */ |
365 | |
366 | #define __TBB_RECYCLE_TO_ENQUEUE __TBB_BUILD // keep non-official |
367 | |
368 | #ifndef __TBB_ARENA_OBSERVER |
369 | #define __TBB_ARENA_OBSERVER __TBB_SCHEDULER_OBSERVER |
370 | #endif /* __TBB_ARENA_OBSERVER */ |
371 | |
372 | #ifndef __TBB_ARENA_BINDING |
373 | #define __TBB_ARENA_BINDING 1 |
374 | #endif |
375 | |
376 | #if TBB_PREVIEW_WAITING_FOR_WORKERS || __TBB_BUILD |
377 | #define __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 1 |
378 | #endif |
379 | |
380 | #if (TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION || __TBB_BUILD) && __TBB_ARENA_BINDING |
381 | #define __TBB_PREVIEW_TASK_ARENA_CONSTRAINTS_EXTENSION_PRESENT 1 |
382 | #endif |
383 | |
384 | #ifndef __TBB_ENQUEUE_ENFORCED_CONCURRENCY |
385 | #define __TBB_ENQUEUE_ENFORCED_CONCURRENCY 1 |
386 | #endif |
387 | |
388 | #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && \ |
389 | (_WIN32 || _WIN64 || __APPLE__ || (__unix__ && !__ANDROID__)) |
390 | #define __TBB_SURVIVE_THREAD_SWITCH 1 |
391 | #endif /* __TBB_SURVIVE_THREAD_SWITCH */ |
392 | |
393 | #ifndef TBB_PREVIEW_FLOW_GRAPH_FEATURES |
394 | #define TBB_PREVIEW_FLOW_GRAPH_FEATURES __TBB_CPF_BUILD |
395 | #endif |
396 | |
397 | #ifndef __TBB_DEFAULT_PARTITIONER |
398 | #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner |
399 | #endif |
400 | |
401 | #ifndef __TBB_FLOW_TRACE_CODEPTR |
402 | #define __TBB_FLOW_TRACE_CODEPTR __TBB_CPF_BUILD |
403 | #endif |
404 | |
405 | // Intel(R) C++ Compiler starts analyzing usages of the deprecated content at the template |
406 | // instantiation site, which is too late for suppression of the corresponding messages for internal |
407 | // stuff. |
408 | #if !defined(__INTEL_COMPILER) && (!defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) || (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0)) |
409 | #if (__TBB_LANG >= 201402L && (!defined(_MSC_VER) || _MSC_VER >= 1920)) |
410 | #define __TBB_DEPRECATED [[deprecated]] |
411 | #define __TBB_DEPRECATED_MSG(msg) [[deprecated(msg)]] |
412 | #elif _MSC_VER |
413 | #define __TBB_DEPRECATED __declspec(deprecated) |
414 | #define __TBB_DEPRECATED_MSG(msg) __declspec(deprecated(msg)) |
415 | #elif (__GNUC__ && __TBB_GCC_VERSION >= 40805) || __clang__ |
416 | #define __TBB_DEPRECATED __attribute__((deprecated)) |
417 | #define __TBB_DEPRECATED_MSG(msg) __attribute__((deprecated(msg))) |
418 | #endif |
419 | #endif // !defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) || (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0) |
420 | |
421 | #if !defined(__TBB_DEPRECATED) |
422 | #define __TBB_DEPRECATED |
423 | #define __TBB_DEPRECATED_MSG(msg) |
424 | #elif !defined(__TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES) |
425 | // Suppress deprecated messages from self |
426 | #define __TBB_SUPPRESS_INTERNAL_DEPRECATED_MESSAGES 1 |
427 | #endif |
428 | |
429 | #if defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) && (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0) |
430 | #define __TBB_DEPRECATED_VERBOSE __TBB_DEPRECATED |
431 | #define __TBB_DEPRECATED_VERBOSE_MSG(msg) __TBB_DEPRECATED_MSG(msg) |
432 | #else |
433 | #define __TBB_DEPRECATED_VERBOSE |
434 | #define __TBB_DEPRECATED_VERBOSE_MSG(msg) |
435 | #endif // (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0) |
436 | |
437 | #if (!defined(TBB_SUPPRESS_DEPRECATED_MESSAGES) || (TBB_SUPPRESS_DEPRECATED_MESSAGES == 0)) && !(__TBB_LANG >= 201103L || _MSC_VER >= 1900) |
438 | #pragma message("TBB Warning: Support for C++98/03 is deprecated. Please use the compiler that supports C++11 features at least.") |
439 | #endif |
440 | |
441 | #ifdef _VARIADIC_MAX |
442 | #define __TBB_VARIADIC_MAX _VARIADIC_MAX |
443 | #else |
444 | #if _MSC_VER == 1700 |
445 | #define __TBB_VARIADIC_MAX 5 // VS11 setting, issue resolved in VS12 |
446 | #elif _MSC_VER == 1600 |
447 | #define __TBB_VARIADIC_MAX 10 // VS10 setting |
448 | #else |
449 | #define __TBB_VARIADIC_MAX 15 |
450 | #endif |
451 | #endif |
452 | |
453 | #if __SANITIZE_THREAD__ |
454 | #define __TBB_USE_THREAD_SANITIZER 1 |
455 | #elif defined(__has_feature) |
456 | #if __has_feature(thread_sanitizer) |
457 | #define __TBB_USE_THREAD_SANITIZER 1 |
458 | #endif |
459 | #endif |
460 | |
461 | #ifndef __TBB_USE_SANITIZERS |
462 | #define __TBB_USE_SANITIZERS (__TBB_USE_THREAD_SANITIZER || __TBB_USE_ADDRESS_SANITIZER) |
463 | #endif |
464 | |
465 | #ifndef __TBB_RESUMABLE_TASKS_USE_THREADS |
466 | #define __TBB_RESUMABLE_TASKS_USE_THREADS __TBB_USE_SANITIZERS |
467 | #endif |
468 | |
469 | #ifndef __TBB_USE_CONSTRAINTS |
470 | #define __TBB_USE_CONSTRAINTS 1 |
471 | #endif |
472 | |
473 | #ifndef __TBB_STRICT_CONSTRAINTS |
474 | #define __TBB_STRICT_CONSTRAINTS 1 |
475 | #endif |
476 | |
477 | #if __TBB_CPP20_CONCEPTS_PRESENT && __TBB_USE_CONSTRAINTS |
478 | #define __TBB_requires(...) requires __VA_ARGS__ |
479 | #else // __TBB_CPP20_CONCEPTS_PRESENT |
480 | #define __TBB_requires(...) |
481 | #endif // __TBB_CPP20_CONCEPTS_PRESENT |
482 | |
483 | /** Macros of the form __TBB_XXX_BROKEN denote known issues that are caused by |
484 | the bugs in compilers, standard or OS specific libraries. They should be |
485 | removed as soon as the corresponding bugs are fixed or the buggy OS/compiler |
486 | versions go out of the support list. |
487 | **/ |
488 | |
489 | // Some STL containers not support allocator traits in old GCC versions |
490 | #if __GXX_EXPERIMENTAL_CXX0X__ && __TBB_GLIBCXX_VERSION <= 50301 |
491 | #define TBB_ALLOCATOR_TRAITS_BROKEN 1 |
492 | #endif |
493 | |
494 | // GCC 4.8 C++ standard library implements std::this_thread::yield as no-op. |
495 | #if __TBB_GLIBCXX_VERSION >= 40800 && __TBB_GLIBCXX_VERSION < 40900 |
496 | #define __TBB_GLIBCXX_THIS_THREAD_YIELD_BROKEN 1 |
497 | #endif |
498 | |
499 | /** End of __TBB_XXX_BROKEN macro section **/ |
500 | |
501 | #if defined(_MSC_VER) && _MSC_VER>=1500 && !defined(__INTEL_COMPILER) |
502 | // A macro to suppress erroneous or benign "unreachable code" MSVC warning (4702) |
503 | #define __TBB_MSVC_UNREACHABLE_CODE_IGNORED 1 |
504 | #endif |
505 | |
506 | // Many OS versions (Android 4.0.[0-3] for example) need workaround for dlopen to avoid non-recursive loader lock hang |
507 | // Setting the workaround for all compile targets ($APP_PLATFORM) below Android 4.4 (android-19) |
508 | #if __ANDROID__ |
509 | #include <android/api-level.h> |
510 | #endif |
511 | |
512 | #define __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING (TBB_PREVIEW_FLOW_GRAPH_FEATURES) |
513 | |
514 | #ifndef __TBB_PREVIEW_CRITICAL_TASKS |
515 | #define __TBB_PREVIEW_CRITICAL_TASKS 1 |
516 | #endif |
517 | |
518 | #ifndef __TBB_PREVIEW_FLOW_GRAPH_NODE_SET |
519 | #define __TBB_PREVIEW_FLOW_GRAPH_NODE_SET (TBB_PREVIEW_FLOW_GRAPH_FEATURES) |
520 | #endif |
521 | |
522 | #if TBB_PREVIEW_MUTEXES || __TBB_BUILD |
523 | #define __TBB_PREVIEW_MUTEXES 1 |
524 | #endif |
525 | |
526 | #if TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS |
527 | #define __TBB_PREVIEW_CONCURRENT_HASH_MAP_EXTENSIONS 1 |
528 | #endif |
529 | |
530 | #if TBB_PREVIEW_TASK_GROUP_EXTENSIONS || __TBB_BUILD |
531 | #define __TBB_PREVIEW_TASK_GROUP_EXTENSIONS 1 |
532 | #endif |
533 | |
534 | #if TBB_PREVIEW_COLLABORATIVE_CALL_ONCE || __TBB_BUILD |
535 | #define __TBB_PREVIEW_COLLABORATIVE_CALL_ONCE 1 |
536 | #endif |
537 | |
538 | #endif // __TBB_detail__config_H |
539 | |