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

source code of include/oneapi/tbb/detail/_config.h