Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
tbb_config.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2005-2019 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_tbb_config_H
18
#define __TBB_tbb_config_H
19
28
/* This macro marks incomplete code or comments describing ideas which are considered for the future.
29
* See also for plain comment with TODO and FIXME marks for small improvement opportunities.
30
*/
31
#define __TBB_TODO 0
32
33
/* Check which standard library we use. */
34
/* __TBB_SYMBOL is defined only while processing exported symbols list where C++ is not allowed. */
35
#if !defined(__TBB_SYMBOL) && !__TBB_CONFIG_PREPROC_ONLY
36
#include <cstddef>
37
#endif
38
39
// Note that when ICC or Clang is in use, __TBB_GCC_VERSION might not fully match
40
// the actual GCC version on the system.
41
#define __TBB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
42
43
// Prior to GCC 7, GNU libstdc++ did not have a convenient version macro.
44
// Therefore we use different ways to detect its version.
45
#ifdef TBB_USE_GLIBCXX_VERSION
46
// The version is explicitly specified in our public TBB_USE_GLIBCXX_VERSION macro.
47
// Its format should match the __TBB_GCC_VERSION above, e.g. 70301 for libstdc++ coming with GCC 7.3.1.
48
#define __TBB_GLIBCXX_VERSION TBB_USE_GLIBCXX_VERSION
49
#elif _GLIBCXX_RELEASE && _GLIBCXX_RELEASE != __GNUC__
50
// Reported versions of GCC and libstdc++ do not match; trust the latter
51
#define __TBB_GLIBCXX_VERSION (_GLIBCXX_RELEASE*10000)
52
#elif __GLIBCPP__ || __GLIBCXX__
53
// The version macro is not defined or matches the GCC version; use __TBB_GCC_VERSION
54
#define __TBB_GLIBCXX_VERSION __TBB_GCC_VERSION
55
#endif
56
57
#if __clang__
58
// according to clang documentation, version can be vendor specific
59
#define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
60
#endif
61
63
#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
64
#define __TBB_IOS 1
65
#endif
66
67
#if __APPLE__
68
#if __INTEL_COMPILER && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1099 \
69
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000
70
// ICC does not correctly set the macro if -mmacosx-min-version is not specified
71
#define __TBB_MACOS_TARGET_VERSION (100000 + 10*(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 1000))
72
#else
73
#define __TBB_MACOS_TARGET_VERSION __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
74
#endif
75
#endif
76
79
#if _WIN32||_WIN64
80
# if defined(_M_X64)||defined(__x86_64__) // the latter for MinGW support
81
# define __TBB_x86_64 1
82
# elif defined(_M_IA64)
83
# define __TBB_ipf 1
84
# elif defined(_M_IX86)||defined(__i386__) // the latter for MinGW support
85
# define __TBB_x86_32 1
86
# else
87
# define __TBB_generic_arch 1
88
# endif
89
#else
/* Assume generic Unix */
90
# if !__linux__ && !__APPLE__
91
# define __TBB_generic_os 1
92
# endif
93
# if __TBB_IOS
94
# define __TBB_generic_arch 1
95
# elif __x86_64__
96
# define __TBB_x86_64 1
97
# elif __ia64__
98
# define __TBB_ipf 1
99
# elif __i386__||__i386 // __i386 is for Sun OS
100
# define __TBB_x86_32 1
101
# else
102
# define __TBB_generic_arch 1
103
# endif
104
#endif
105
106
#if __MIC__ || __MIC2__
107
#define __TBB_DEFINE_MIC 1
108
#endif
109
110
#define __TBB_TSX_AVAILABLE ((__TBB_x86_32 || __TBB_x86_64) && !__TBB_DEFINE_MIC)
111
114
#if __INTEL_COMPILER == 9999 && __INTEL_COMPILER_BUILD_DATE == 20110811
115
/* Intel(R) Composer XE 2011 Update 6 incorrectly sets __INTEL_COMPILER. Fix it. */
116
#undef __INTEL_COMPILER
117
#define __INTEL_COMPILER 1210
118
#endif
119
120
#if __clang__ && !__INTEL_COMPILER
121
#define __TBB_USE_OPTIONAL_RTTI __has_feature(cxx_rtti)
122
#elif defined(_CPPRTTI)
123
#define __TBB_USE_OPTIONAL_RTTI 1
124
#else
125
#define __TBB_USE_OPTIONAL_RTTI (__GXX_RTTI || __RTTI || __INTEL_RTTI__)
126
#endif
127
128
#if __TBB_GCC_VERSION >= 40400 && !defined(__INTEL_COMPILER)
129
130
#define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
131
#endif
132
133
/* Select particular features of C++11 based on compiler version.
134
ICC 12.1 (Linux*), GCC 4.3 and higher, clang 2.9 and higher
135
set __GXX_EXPERIMENTAL_CXX0X__ in c++11 mode.
136
137
Compilers that mimics other compilers (ICC, clang) must be processed before
138
compilers they mimic (GCC, MSVC).
139
140
TODO: The following conditions should be extended when new compilers/runtimes
141
support added.
142
*/
143
149
#define __TBB_CPP11_PRESENT (__cplusplus >= 201103L || _MSC_VER >= 1900)
150
151
#define __TBB_CPP17_FALLTHROUGH_PRESENT (__cplusplus >= 201703L)
152
#define __TBB_FALLTHROUGH_PRESENT (__TBB_GCC_VERSION >= 70000 && !__INTEL_COMPILER)
153
158
#if __INTEL_COMPILER && !__INTEL_CXX11_MODE__
159
// __INTEL_CXX11_MODE__ is not set, try to deduce it
160
#define __INTEL_CXX11_MODE__ (__GXX_EXPERIMENTAL_CXX0X__ || (_MSC_VER && __STDC_HOSTED__))
161
#endif
162
163
#if __INTEL_COMPILER && (!_MSC_VER || __INTEL_CXX11_MODE__)
164
// On Windows, C++11 features supported by Visual Studio 2010 and higher are enabled by default,
165
// so in absence of /Qstd= use MSVC branch for feature detection.
166
// On other platforms, no -std= means C++03.
167
168
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__INTEL_CXX11_MODE__ && __VARIADIC_TEMPLATES)
169
// Both r-value reference support in compiler and std::move/std::forward
170
// presence in C++ standard library is checked.
171
#define __TBB_CPP11_RVALUE_REF_PRESENT ((_MSC_VER >= 1700 || __GXX_EXPERIMENTAL_CXX0X__ && (__TBB_GLIBCXX_VERSION >= 40500 || _LIBCPP_VERSION)) && __INTEL_COMPILER >= 1400)
172
#define __TBB_IMPLICIT_MOVE_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400 && (_MSC_VER >= 1900 || __TBB_GCC_VERSION >= 40600 || __clang__))
173
#if _MSC_VER >= 1600
174
#define __TBB_EXCEPTION_PTR_PRESENT ( __INTEL_COMPILER > 1300 \
175
/*ICC 12.1 Upd 10 and 13 beta Upd 2 fixed exception_ptr linking issue*/
\
176
|| (__INTEL_COMPILER == 1300 && __INTEL_COMPILER_BUILD_DATE >= 20120530) \
177
|| (__INTEL_COMPILER == 1210 && __INTEL_COMPILER_BUILD_DATE >= 20120410) )
178
181
#elif __TBB_GLIBCXX_VERSION >= 40404 && __TBB_GLIBCXX_VERSION < 40600
182
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1200)
183
#elif __TBB_GLIBCXX_VERSION >= 40600
184
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1300)
185
#elif _LIBCPP_VERSION
186
#define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
187
#else
188
#define __TBB_EXCEPTION_PTR_PRESENT 0
189
#endif
190
#define __TBB_STATIC_ASSERT_PRESENT (__INTEL_CXX11_MODE__ || _MSC_VER >= 1600)
191
#define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && (__TBB_GLIBCXX_VERSION >= 40300 || _LIBCPP_VERSION))
192
#define __TBB_INITIALIZER_LISTS_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400 && (_MSC_VER >= 1800 || __TBB_GLIBCXX_VERSION >= 40400 || _LIBCPP_VERSION))
193
#define __TBB_CONSTEXPR_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400)
194
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1200)
195
196
#define __TBB_NOEXCEPT_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1300 && (__TBB_GLIBCXX_VERSION >= 40600 || _LIBCPP_VERSION || _MSC_VER))
197
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (_MSC_VER >= 1700 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1310 && (__TBB_GLIBCXX_VERSION >= 40600 || _LIBCPP_VERSION))
198
#define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210)
199
#define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210)
200
#define __TBB_CPP11_LAMBDAS_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1200)
201
#define __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT (_MSC_VER >= 1800 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210)
202
#define __TBB_OVERRIDE_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400)
203
#define __TBB_ALIGNAS_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1500)
204
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT (__INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1210)
205
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__cplusplus >= 201402L)
206
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__cplusplus >= 201402L)
207
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__INTEL_COMPILER > 1910) // a future version
208
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__cplusplus >= 201703L)
209
#elif __clang__
210
211
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __has_feature(__cxx_variadic_templates__)
212
#define __TBB_CPP11_RVALUE_REF_PRESENT (__has_feature(__cxx_rvalue_references__) && (_LIBCPP_VERSION || __TBB_GLIBCXX_VERSION >= 40500))
213
#define __TBB_IMPLICIT_MOVE_PRESENT __has_feature(cxx_implicit_moves)
214
215
#define __TBB_EXCEPTION_PTR_PRESENT (__cplusplus >= 201103L && (_LIBCPP_VERSION || __TBB_GLIBCXX_VERSION >= 40600))
216
#define __TBB_STATIC_ASSERT_PRESENT __has_feature(__cxx_static_assert__)
217
219
#if (__GXX_EXPERIMENTAL_CXX0X__ && __has_include(<tuple>))
220
#define __TBB_CPP11_TUPLE_PRESENT 1
221
#endif
222
#if (__has_feature(__cxx_generalized_initializers__) && __has_include(<initializer_list>))
223
#define __TBB_INITIALIZER_LISTS_PRESENT 1
224
#endif
225
#define __TBB_CONSTEXPR_PRESENT __has_feature(__cxx_constexpr__)
226
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (__has_feature(__cxx_defaulted_functions__) && __has_feature(__cxx_deleted_functions__))
227
228
#define __TBB_NOEXCEPT_PRESENT (__cplusplus >= 201103L)
229
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (__has_feature(__cxx_range_for__) && (_LIBCPP_VERSION || __TBB_GLIBCXX_VERSION >= 40600))
230
#define __TBB_CPP11_AUTO_PRESENT __has_feature(__cxx_auto_type__)
231
#define __TBB_CPP11_DECLTYPE_PRESENT __has_feature(__cxx_decltype__)
232
#define __TBB_CPP11_LAMBDAS_PRESENT __has_feature(cxx_lambdas)
233
#define __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT __has_feature(cxx_default_function_template_args)
234
#define __TBB_OVERRIDE_PRESENT __has_feature(cxx_override_control)
235
#define __TBB_ALIGNAS_PRESENT __has_feature(cxx_alignas)
236
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT __has_feature(cxx_alias_templates)
237
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__cplusplus >= 201402L)
238
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__has_feature(cxx_variable_templates))
239
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__has_feature(__cpp_deduction_guides))
240
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__has_feature(__cpp_lib_is_invocable))
241
#elif __GNUC__
242
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__
243
#define __TBB_CPP11_VARIADIC_FIXED_LENGTH_EXP_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40700)
244
#define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40500)
245
#define __TBB_IMPLICIT_MOVE_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600)
246
250
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40404 && (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 || (__TBB_GCC_VERSION >= 70000)))
251
#define __TBB_STATIC_ASSERT_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)
252
#define __TBB_CPP11_TUPLE_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)
253
#define __TBB_INITIALIZER_LISTS_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)
254
255
#define __TBB_CONSTEXPR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)
256
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)
257
#define __TBB_NOEXCEPT_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600)
258
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600)
259
#define __TBB_CPP11_AUTO_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)
260
#define __TBB_CPP11_DECLTYPE_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40400)
261
#define __TBB_CPP11_LAMBDAS_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40500)
262
#define __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)
263
#define __TBB_OVERRIDE_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40700)
264
#define __TBB_ALIGNAS_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40800)
265
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40700)
266
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__cplusplus >= 201402L && __TBB_GCC_VERSION >= 50000)
267
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__cplusplus >= 201402L && __TBB_GCC_VERSION >= 50000)
268
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__cpp_deduction_guides >= 201606L)
269
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__cplusplus >= 201703L && __TBB_GCC_VERSION >= 70000)
270
#elif _MSC_VER
271
// These definitions are also used with Intel C++ Compiler in "default" mode (__INTEL_CXX11_MODE__ == 0);
272
// see a comment in "__INTEL_COMPILER" section above.
273
274
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (_MSC_VER >= 1800)
275
// Contains a workaround for ICC 13
276
#define __TBB_CPP11_RVALUE_REF_PRESENT (_MSC_VER >= 1700 && (!__INTEL_COMPILER || __INTEL_COMPILER >= 1400))
277
#define __TBB_IMPLICIT_MOVE_PRESENT (_MSC_VER >= 1900)
278
#define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
279
#define __TBB_STATIC_ASSERT_PRESENT (_MSC_VER >= 1600)
280
#define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600)
281
#define __TBB_INITIALIZER_LISTS_PRESENT (_MSC_VER >= 1800)
282
#define __TBB_CONSTEXPR_PRESENT (_MSC_VER >= 1900)
283
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (_MSC_VER >= 1800)
284
#define __TBB_NOEXCEPT_PRESENT (_MSC_VER >= 1900)
285
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (_MSC_VER >= 1700)
286
#define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600)
287
#define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600)
288
#define __TBB_CPP11_LAMBDAS_PRESENT (_MSC_VER >= 1600)
289
#define __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT (_MSC_VER >= 1800)
290
#define __TBB_OVERRIDE_PRESENT (_MSC_VER >= 1700)
291
#define __TBB_ALIGNAS_PRESENT (_MSC_VER >= 1900)
292
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT (_MSC_VER >= 1800)
293
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (_MSC_VER >= 1900)
294
/* Variable templates are supported in VS2015 Update 2 or later */
295
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (_MSC_FULL_VER >= 190023918 && (!__INTEL_COMPILER || __INTEL_COMPILER >= 1700))
296
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (_MSVC_LANG >= 201703L && _MSC_VER >= 1914)
297
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (_MSVC_LANG >= 201703L && _MSC_VER >= 1911)
298
#else
299
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __TBB_CPP11_PRESENT
300
#define __TBB_CPP11_RVALUE_REF_PRESENT __TBB_CPP11_PRESENT
301
#define __TBB_IMPLICIT_MOVE_PRESENT __TBB_CPP11_PRESENT
302
#define __TBB_EXCEPTION_PTR_PRESENT __TBB_CPP11_PRESENT
303
#define __TBB_STATIC_ASSERT_PRESENT __TBB_CPP11_PRESENT
304
#define __TBB_CPP11_TUPLE_PRESENT __TBB_CPP11_PRESENT
305
#define __TBB_INITIALIZER_LISTS_PRESENT __TBB_CPP11_PRESENT
306
#define __TBB_CONSTEXPR_PRESENT __TBB_CPP11_PRESENT
307
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT __TBB_CPP11_PRESENT
308
#define __TBB_NOEXCEPT_PRESENT __TBB_CPP11_PRESENT
309
#define __TBB_CPP11_STD_BEGIN_END_PRESENT __TBB_CPP11_PRESENT
310
#define __TBB_CPP11_AUTO_PRESENT __TBB_CPP11_PRESENT
311
#define __TBB_CPP11_DECLTYPE_PRESENT __TBB_CPP11_PRESENT
312
#define __TBB_CPP11_LAMBDAS_PRESENT __TBB_CPP11_PRESENT
313
#define __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT __TBB_CPP11_PRESENT
314
#define __TBB_OVERRIDE_PRESENT __TBB_CPP11_PRESENT
315
#define __TBB_ALIGNAS_PRESENT __TBB_CPP11_PRESENT
316
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT __TBB_CPP11_PRESENT
317
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__cplusplus >= 201402L)
318
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__cplusplus >= 201402L)
319
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__cplusplus >= 201703L)
320
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__cplusplus >= 201703L)
321
#endif
322
323
// C++11 standard library features
324
325
#define __TBB_CPP11_ARRAY_PRESENT (_MSC_VER >= 1700 || _LIBCPP_VERSION || __GXX_EXPERIMENTAL_CXX0X__ && __TBB_GLIBCXX_VERSION >= 40300)
326
327
#ifndef __TBB_CPP11_VARIADIC_FIXED_LENGTH_EXP_PRESENT
328
#define __TBB_CPP11_VARIADIC_FIXED_LENGTH_EXP_PRESENT __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT
329
#endif
330
#define __TBB_CPP11_VARIADIC_TUPLE_PRESENT (!_MSC_VER || _MSC_VER >= 1800)
331
332
#define __TBB_CPP11_TYPE_PROPERTIES_PRESENT (_LIBCPP_VERSION || _MSC_VER >= 1700 || (__TBB_GLIBCXX_VERSION >= 50000 && __GXX_EXPERIMENTAL_CXX0X__))
333
#define __TBB_TR1_TYPE_PROPERTIES_IN_STD_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GLIBCXX_VERSION >= 40300 || _MSC_VER >= 1600)
334
// GCC supported some of type properties since 4.7
335
#define __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GLIBCXX_VERSION >= 40700 || __TBB_CPP11_TYPE_PROPERTIES_PRESENT)
336
337
// In GCC, std::move_if_noexcept appeared later than noexcept
338
#define __TBB_MOVE_IF_NOEXCEPT_PRESENT (__TBB_NOEXCEPT_PRESENT && (__TBB_GLIBCXX_VERSION >= 40700 || _MSC_VER >= 1900 || _LIBCPP_VERSION))
339
#define __TBB_ALLOCATOR_TRAITS_PRESENT (__cplusplus >= 201103L && _LIBCPP_VERSION || _MSC_VER >= 1800 || \
340
__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GLIBCXX_VERSION >= 40700 && !(__TBB_GLIBCXX_VERSION == 40700 && __TBB_DEFINE_MIC))
341
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__TBB_EXCEPTION_PTR_PRESENT && (_MSC_VER >= 1700 || __TBB_GLIBCXX_VERSION >= 40600 || _LIBCPP_VERSION || __SUNPRO_CC))
342
343
// Due to libc++ limitations in C++03 mode, do not pass rvalues to std::make_shared()
344
#define __TBB_CPP11_SMART_POINTERS_PRESENT ( _MSC_VER >= 1600 || _LIBCPP_VERSION \
345
|| ((__cplusplus >= 201103L || __GXX_EXPERIMENTAL_CXX0X__) \
346
&& (__TBB_GLIBCXX_VERSION >= 40500 || __TBB_GLIBCXX_VERSION >= 40400 && __TBB_USE_OPTIONAL_RTTI)) )
347
348
#define __TBB_CPP11_FUTURE_PRESENT (_MSC_VER >= 1700 || __TBB_GLIBCXX_VERSION >= 40600 && __GXX_EXPERIMENTAL_CXX0X__ || _LIBCPP_VERSION)
349
350
#define __TBB_CPP11_GET_NEW_HANDLER_PRESENT (_MSC_VER >= 1900 || __TBB_GLIBCXX_VERSION >= 40900 && __GXX_EXPERIMENTAL_CXX0X__ || _LIBCPP_VERSION)
351
352
#define __TBB_CPP17_UNCAUGHT_EXCEPTIONS_PRESENT (_MSC_VER >= 1900 || __GLIBCXX__ && __cpp_lib_uncaught_exceptions \
353
|| _LIBCPP_VERSION >= 3700 && (!__TBB_MACOS_TARGET_VERSION || __TBB_MACOS_TARGET_VERSION >= 101200))
354
// TODO: wait when memory_resource will be fully supported in clang and define the right macro
355
// Currently it is in experimental stage since 6 version.
356
#define __TBB_CPP17_MEMORY_RESOURCE_PRESENT (_MSC_VER >= 1913 && (_MSVC_LANG > 201402L || __cplusplus > 201402L) || \
357
__GLIBCXX__ && __cpp_lib_memory_resource >= 201603)
358
#define __TBB_CPP17_HW_INTERFERENCE_SIZE_PRESENT (_MSC_VER >= 1911)
359
// std::swap is in <utility> only since C++11, though MSVC had it at least since VS2005
360
#if _MSC_VER>=1400 || _LIBCPP_VERSION || __GXX_EXPERIMENTAL_CXX0X__
361
#define __TBB_STD_SWAP_HEADER <utility>
362
#else
363
#define __TBB_STD_SWAP_HEADER <algorithm>
364
#endif
365
366
//TODO: not clear how exactly this macro affects exception_ptr - investigate
367
// On linux ICC fails to find existing std::exception_ptr in libstdc++ without this define
368
#if __INTEL_COMPILER && __GNUC__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
369
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
370
#endif
371
372
// Work around a bug in MinGW32
373
#if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
374
#define _GLIBCXX_ATOMIC_BUILTINS_4
375
#endif
376
377
#if __GNUC__ || __SUNPRO_CC || __IBMCPP__
378
/* ICC defines __GNUC__ and so is covered */
379
#define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
380
#elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
381
#define __TBB_DECLSPEC_ALIGN_PRESENT 1
382
#endif
383
384
/* Actually ICC supports gcc __sync_* intrinsics starting 11.1,
385
* but 64 bit support for 32 bit target comes in later ones*/
386
/* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become optional */
387
/* Assumed that all clang versions have these gcc compatible intrinsics. */
388
#if __TBB_GCC_VERSION >= 40306 || __INTEL_COMPILER >= 1200 || __clang__
389
390
#define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
391
#endif
392
393
#if __TBB_GCC_VERSION >= 70000 && !__INTEL_COMPILER && !__clang__
394
// After GCC7 there was possible reordering problem in generic atomic load/store operations.
395
// So always using builtins.
396
#define TBB_USE_GCC_BUILTINS 1
397
#endif
398
399
#if __INTEL_COMPILER >= 1200
400
401
#define __TBB_ICC_BUILTIN_ATOMICS_PRESENT 1
402
#endif
403
404
#if _MSC_VER>=1600 && (!__INTEL_COMPILER || __INTEL_COMPILER>=1310)
405
#define __TBB_MSVC_PART_WORD_INTERLOCKED_INTRINSICS_PRESENT 1
406
#endif
407
408
#define __TBB_TSX_INTRINSICS_PRESENT ((__RTM__ || _MSC_VER>=1700 || __INTEL_COMPILER>=1300) && !__TBB_DEFINE_MIC && !__ANDROID__)
409
411
#define __TBB_CONCAT_AUX(A,B) A##B
412
// The additional level of indirection is needed to expand macros A and B (not to get the AB macro).
413
// See [cpp.subst] and [cpp.concat] for more details.
414
#define __TBB_CONCAT(A,B) __TBB_CONCAT_AUX(A,B)
415
// The IGNORED argument and comma are needed to always have 2 arguments (even when A is empty).
416
#define __TBB_IS_MACRO_EMPTY(A,IGNORED) __TBB_CONCAT_AUX(__TBB_MACRO_EMPTY,A)
417
#define __TBB_MACRO_EMPTY 1
418
420
#ifndef TBB_USE_DEBUG
421
/*
422
There are four cases that are supported:
423
1. "_DEBUG is undefined" means "no debug";
424
2. "_DEBUG defined to something that is evaluated to 0" (including "garbage", as per [cpp.cond]) means "no debug";
425
3. "_DEBUG defined to something that is evaluated to a non-zero value" means "debug";
426
4. "_DEBUG defined to nothing (empty)" means "debug".
427
*/
428
#ifdef _DEBUG
429
// Check if _DEBUG is empty.
430
#define __TBB_IS__DEBUG_EMPTY (__TBB_IS_MACRO_EMPTY(_DEBUG,IGNORED)==__TBB_MACRO_EMPTY)
431
#if __TBB_IS__DEBUG_EMPTY
432
#define TBB_USE_DEBUG 1
433
#else
434
#define TBB_USE_DEBUG _DEBUG
435
#endif
/* __TBB_IS__DEBUG_EMPTY */
436
#else
437
#define TBB_USE_DEBUG 0
438
#endif
439
#endif
/* TBB_USE_DEBUG */
440
441
#ifndef TBB_USE_ASSERT
442
#define TBB_USE_ASSERT TBB_USE_DEBUG
443
#endif
/* TBB_USE_ASSERT */
444
445
#ifndef TBB_USE_THREADING_TOOLS
446
#define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
447
#endif
/* TBB_USE_THREADING_TOOLS */
448
449
#ifndef TBB_USE_PERFORMANCE_WARNINGS
450
#ifdef TBB_PERFORMANCE_WARNINGS
451
#define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
452
#else
453
#define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
454
#endif
/* TBB_PERFORMANCE_WARNINGS */
455
#endif
/* TBB_USE_PERFORMANCE_WARNINGS */
456
457
#if __TBB_DEFINE_MIC
458
#if TBB_USE_EXCEPTIONS
459
#error The platform does not properly support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
460
#elif !defined(TBB_USE_EXCEPTIONS)
461
#define TBB_USE_EXCEPTIONS 0
462
#endif
463
#elif !(__EXCEPTIONS || defined(_CPPUNWIND) || __SUNPRO_CC)
464
#if TBB_USE_EXCEPTIONS
465
#error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
466
#elif !defined(TBB_USE_EXCEPTIONS)
467
#define TBB_USE_EXCEPTIONS 0
468
#endif
469
#elif !defined(TBB_USE_EXCEPTIONS)
470
#define TBB_USE_EXCEPTIONS 1
471
#endif
472
473
#ifndef TBB_IMPLEMENT_CPP0X
474
475
#if __clang__
476
/* Old versions of Intel C++ Compiler do not have __has_include or cannot use it in #define */
477
#if (__INTEL_COMPILER && (__INTEL_COMPILER < 1500 || __INTEL_COMPILER == 1500 && __INTEL_COMPILER_UPDATE <= 1))
478
#define TBB_IMPLEMENT_CPP0X (__cplusplus < 201103L || !_LIBCPP_VERSION)
479
#else
480
#define TBB_IMPLEMENT_CPP0X (__cplusplus < 201103L || (!__has_include(<thread>) && !__has_include(<condition_variable>)))
481
#endif
482
#elif __GNUC__
483
#define TBB_IMPLEMENT_CPP0X (__TBB_GCC_VERSION < 40400 || !__GXX_EXPERIMENTAL_CXX0X__)
484
#elif _MSC_VER
485
#define TBB_IMPLEMENT_CPP0X (_MSC_VER < 1700)
486
#else
487
// TODO: Reconsider general approach to be more reliable, e.g. (!(__cplusplus >= 201103L && __ STDC_HOSTED__))
488
#define TBB_IMPLEMENT_CPP0X (!__STDCPP_THREADS__)
489
#endif
490
#endif
/* TBB_IMPLEMENT_CPP0X */
491
492
/* TBB_USE_CAPTURED_EXCEPTION should be explicitly set to either 0 or 1, as it is used as C++ const */
493
#ifndef TBB_USE_CAPTURED_EXCEPTION
494
495
#if __TBB_EXCEPTION_PTR_PRESENT && !defined(__ia64__)
496
#define TBB_USE_CAPTURED_EXCEPTION 0
497
#else
498
#define TBB_USE_CAPTURED_EXCEPTION 1
499
#endif
500
#else
/* defined TBB_USE_CAPTURED_EXCEPTION */
501
#if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
502
#error Current runtime does not support std::exception_ptr. Set TBB_USE_CAPTURED_EXCEPTION and make sure that your code is ready to catch tbb::captured_exception.
503
#endif
504
#endif
/* defined TBB_USE_CAPTURED_EXCEPTION */
505
507
#if TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT
508
#error "GCC atomic built-ins are not supported."
509
#endif
510
515
// TODO: Add cpp11 random generation macro
516
#ifndef __TBB_CONCURRENT_ORDERED_CONTAINERS_PRESENT
517
#define __TBB_CONCURRENT_ORDERED_CONTAINERS_PRESENT ( __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT \
518
&& __TBB_IMPLICIT_MOVE_PRESENT && __TBB_CPP11_AUTO_PRESENT && __TBB_CPP11_LAMBDAS_PRESENT && __TBB_CPP11_ARRAY_PRESENT \
519
&& __TBB_INITIALIZER_LISTS_PRESENT )
520
#endif
521
523
#ifndef __TBB_WEAK_SYMBOLS_PRESENT
524
#define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) )
525
#endif
526
528
#ifndef __TBB_DYNAMIC_LOAD_ENABLED
529
#define __TBB_DYNAMIC_LOAD_ENABLED 1
530
#endif
531
535
#if (_WIN32||_WIN64) && (__TBB_SOURCE_DIRECTLY_INCLUDED || TBB_USE_PREVIEW_BINARY)
536
#define __TBB_NO_IMPLICIT_LINKAGE 1
537
#define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
538
#endif
539
540
#ifndef __TBB_COUNT_TASK_NODES
541
#define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
542
#endif
543
544
#ifndef __TBB_TASK_GROUP_CONTEXT
545
#define __TBB_TASK_GROUP_CONTEXT 1
546
#endif
/* __TBB_TASK_GROUP_CONTEXT */
547
548
#ifndef __TBB_SCHEDULER_OBSERVER
549
#define __TBB_SCHEDULER_OBSERVER 1
550
#endif
/* __TBB_SCHEDULER_OBSERVER */
551
552
#ifndef __TBB_FP_CONTEXT
553
#define __TBB_FP_CONTEXT __TBB_TASK_GROUP_CONTEXT
554
#endif
/* __TBB_FP_CONTEXT */
555
556
#if __TBB_FP_CONTEXT && !__TBB_TASK_GROUP_CONTEXT
557
#error __TBB_FP_CONTEXT requires __TBB_TASK_GROUP_CONTEXT to be enabled
558
#endif
559
560
#define __TBB_RECYCLE_TO_ENQUEUE __TBB_BUILD // keep non-official
561
562
#ifndef __TBB_ARENA_OBSERVER
563
#define __TBB_ARENA_OBSERVER __TBB_SCHEDULER_OBSERVER
564
#endif
/* __TBB_ARENA_OBSERVER */
565
566
#ifndef __TBB_TASK_ISOLATION
567
#define __TBB_TASK_ISOLATION 1
568
#endif
/* __TBB_TASK_ISOLATION */
569
570
#if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
571
#error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
572
#endif
573
574
#ifndef __TBB_TASK_PRIORITY
575
#define __TBB_TASK_PRIORITY (__TBB_TASK_GROUP_CONTEXT)
576
#endif
/* __TBB_TASK_PRIORITY */
577
578
#if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
579
#error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
580
#endif
581
582
#if TBB_PREVIEW_WAITING_FOR_WORKERS || __TBB_BUILD
583
#define __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 1
584
#endif
585
586
#ifndef __TBB_ENQUEUE_ENFORCED_CONCURRENCY
587
#define __TBB_ENQUEUE_ENFORCED_CONCURRENCY 1
588
#endif
589
590
#if !defined(__TBB_SURVIVE_THREAD_SWITCH) && \
591
(_WIN32 || _WIN64 || __APPLE__ || (__linux__ && !__ANDROID__))
592
#define __TBB_SURVIVE_THREAD_SWITCH 1
593
#endif
/* __TBB_SURVIVE_THREAD_SWITCH */
594
595
#ifndef __TBB_DEFAULT_PARTITIONER
596
#define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
597
#endif
598
599
#ifndef __TBB_USE_PROPORTIONAL_SPLIT_IN_BLOCKED_RANGES
600
#define __TBB_USE_PROPORTIONAL_SPLIT_IN_BLOCKED_RANGES 1
601
#endif
602
603
#ifndef __TBB_ENABLE_RANGE_FEEDBACK
604
#define __TBB_ENABLE_RANGE_FEEDBACK 0
605
#endif
606
607
#ifdef _VARIADIC_MAX
608
#define __TBB_VARIADIC_MAX _VARIADIC_MAX
609
#else
610
#if _MSC_VER == 1700
611
#define __TBB_VARIADIC_MAX 5 // VS11 setting, issue resolved in VS12
612
#elif _MSC_VER == 1600
613
#define __TBB_VARIADIC_MAX 10 // VS10 setting
614
#else
615
#define __TBB_VARIADIC_MAX 15
616
#endif
617
#endif
618
621
// TODO: Separate this single macro into two for Windows 8 Store* (win8ui mode) and UWP/UWD modes.
622
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
623
#define __TBB_WIN8UI_SUPPORT 1
624
#else
625
#define __TBB_WIN8UI_SUPPORT 0
626
#endif
627
634
#if __SIZEOF_POINTER__ < 8 && __ANDROID__ && __TBB_GCC_VERSION <= 40403 && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
635
638
#define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
639
#elif __TBB_x86_32 && __TBB_GCC_VERSION == 40102 && ! __GNUC_RH_RELEASE__
640
643
#define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
644
#endif
645
646
#if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
647
#define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
648
#endif
649
650
#if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
651
654
#define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
655
#endif
656
657
#if !__INTEL_COMPILER && (_MSC_VER && _MSC_VER < 1500 || __GNUC__ && __TBB_GCC_VERSION < 40102)
658
660
#define __TBB_TEMPLATE_FRIENDS_BROKEN 1
661
#endif
662
663
#if __GLIBC__==2 && __GLIBC_MINOR__==3 || (__APPLE__ && ( __INTEL_COMPILER==1200 && !TBB_USE_DEBUG))
664
666
#define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
667
#endif
668
669
#if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
670
671
#define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
672
#endif
673
674
#if __clang__ || (__GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER))
675
676
#define __TBB_PROTECTED_NESTED_CLASS_BROKEN 1
677
#endif
678
679
#if __MINGW32__ && __TBB_GCC_VERSION < 40200
680
682
#define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
683
#endif
684
685
#if __TBB_GCC_VERSION==40300 && !__INTEL_COMPILER && !__clang__
686
/* GCC of this version may rashly ignore control dependencies */
687
#define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
688
#endif
689
690
#if __FreeBSD__
691
693
#define __TBB_PRIO_INHERIT_BROKEN 1
694
697
#define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
698
#endif
/* __FreeBSD__ */
699
700
#if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
701
703
#define __TBB_ICC_ASM_VOLATILE_BROKEN 1
704
#endif
705
706
#if !__INTEL_COMPILER && (_MSC_VER && _MSC_VER < 1700 || __GNUC__==3 && __GNUC_MINOR__<=2)
707
709
#define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
710
#endif
711
712
#if __TBB_DEFINE_MIC
713
714
#define __TBB_MAIN_THREAD_AFFINITY_BROKEN 1
715
#endif
716
717
#if __GXX_EXPERIMENTAL_CXX0X__ && !defined(__EXCEPTIONS) && \
718
((!__INTEL_COMPILER && !__clang__ && (__TBB_GCC_VERSION>=40400 && __TBB_GCC_VERSION<40600)) || \
719
(__INTEL_COMPILER<=1400 && (__TBB_GLIBCXX_VERSION>=40400 && __TBB_GLIBCXX_VERSION<=40801)))
720
/* There is an issue for specific GCC toolchain when C++11 is enabled
721
and exceptions are disabled:
722
exceprion_ptr.h/nested_exception.h use throw unconditionally.
723
GCC can ignore 'throw' since 4.6; but with ICC the issue still exists.
724
*/
725
#define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 1
726
#endif
727
728
#if __INTEL_COMPILER==1300 && __TBB_GLIBCXX_VERSION>=40700 && defined(__GXX_EXPERIMENTAL_CXX0X__)
729
/* Some C++11 features used inside libstdc++ are not supported by Intel C++ Compiler. */
730
#define __TBB_ICC_13_0_CPP11_STDLIB_SUPPORT_BROKEN 1
731
#endif
732
733
#if (__GNUC__==4 && __GNUC_MINOR__==4 ) && !defined(__INTEL_COMPILER) && !defined(__clang__)
734
735
#define __TBB_GCC_STRICT_ALIASING_BROKEN 1
736
/* topical remedy: #pragma GCC diagnostic ignored "-Wstrict-aliasing" */
737
#if !__TBB_GCC_WARNING_SUPPRESSION_PRESENT
738
#error Warning suppression is not supported, while should.
739
#endif
740
#endif
741
742
/* In a PIC mode some versions of GCC 4.1.2 generate incorrect inlined code for 8 byte __sync_val_compare_and_swap intrinsic */
743
#if __TBB_GCC_VERSION == 40102 && __PIC__ && !defined(__INTEL_COMPILER) && !defined(__clang__)
744
#define __TBB_GCC_CAS8_BUILTIN_INLINING_BROKEN 1
745
#endif
746
747
#if __TBB_x86_32 && ( __INTEL_COMPILER || (__GNUC__==5 && __GNUC_MINOR__>=2 && __GXX_EXPERIMENTAL_CXX0X__) \
748
|| (__GNUC__==3 && __GNUC_MINOR__==3) || (__MINGW32__ && __GNUC__==4 && __GNUC_MINOR__==5) || __SUNPRO_CC )
749
// Some compilers for IA-32 architecture fail to provide 8-byte alignment of objects on the stack,
750
// even if the object specifies 8-byte alignment. On such platforms, the implementation
751
// of 64 bit atomics for IA-32 architecture (e.g. atomic<long long>) use different tactics
752
// depending upon whether the object is properly aligned or not.
753
#define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 1
754
#else
755
// Define to 0 explicitly because the macro is used in a compiled code of test_atomic
756
#define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 0
757
#endif
758
759
#if __GNUC__ && !__INTEL_COMPILER && !__clang__ && __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT && __TBB_GCC_VERSION < 40700
760
#define __TBB_ZERO_INIT_WITH_DEFAULTED_CTOR_BROKEN 1
761
#endif
762
763
#if _MSC_VER && _MSC_VER <= 1800 && !__INTEL_COMPILER
764
// With MSVC, when an array is passed by const reference to a template function,
765
// constness from the function parameter may get propagated to the template parameter.
766
#define __TBB_CONST_REF_TO_ARRAY_TEMPLATE_PARAM_BROKEN 1
767
#endif
768
769
// A compiler bug: a disabled copy constructor prevents use of the moving constructor
770
#define __TBB_IF_NO_COPY_CTOR_MOVE_SEMANTICS_BROKEN (_MSC_VER && (__INTEL_COMPILER >= 1300 && __INTEL_COMPILER <= 1310) && !__INTEL_CXX11_MODE__)
771
772
#define __TBB_CPP11_DECLVAL_BROKEN (_MSC_VER == 1600 || (__GNUC__ && __TBB_GCC_VERSION < 40500) )
773
// Intel C++ Compiler has difficulties with copying std::pair with VC11 std::reference_wrapper being a const member
774
#define __TBB_COPY_FROM_NON_CONST_REF_BROKEN (_MSC_VER == 1700 && __INTEL_COMPILER && __INTEL_COMPILER < 1600)
775
776
// The implicit upcasting of the tuple of a reference of a derived class to a base class fails on icc 13.X if the system's gcc environment is 4.8
777
// Also in gcc 4.4 standard library the implementation of the tuple<&> conversion (tuple<A&> a = tuple<B&>, B is inherited from A) is broken.
778
#if __GXX_EXPERIMENTAL_CXX0X__ && __GLIBCXX__ && ((__INTEL_COMPILER >=1300 && __INTEL_COMPILER <=1310 && __TBB_GLIBCXX_VERSION>=40700) || (__TBB_GLIBCXX_VERSION < 40500))
779
#define __TBB_UPCAST_OF_TUPLE_OF_REF_BROKEN 1
780
#endif
781
782
// In some cases decltype of a function adds a reference to a return type.
783
#define __TBB_CPP11_DECLTYPE_OF_FUNCTION_RETURN_TYPE_BROKEN (_MSC_VER == 1600 && !__INTEL_COMPILER)
784
785
// Visual Studio 2013 does not delete the copy constructor when a user-defined move constructor is provided
786
#if _MSC_VER && _MSC_VER <= 1800
787
#define __TBB_IMPLICIT_COPY_DELETION_BROKEN 1
788
#endif
789
792
#if defined(_MSC_VER) && _MSC_VER>=1500 && !defined(__INTEL_COMPILER)
793
// A macro to suppress erroneous or benign "unreachable code" MSVC warning (4702)
794
#define __TBB_MSVC_UNREACHABLE_CODE_IGNORED 1
795
#endif
796
797
#define __TBB_ATOMIC_CTORS (__TBB_CONSTEXPR_PRESENT && __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT && (!__TBB_ZERO_INIT_WITH_DEFAULTED_CTOR_BROKEN))
798
799
// Many OS versions (Android 4.0.[0-3] for example) need workaround for dlopen to avoid non-recursive loader lock hang
800
// Setting the workaround for all compile targets ($APP_PLATFORM) below Android 4.4 (android-19)
801
#if __ANDROID__
802
#include <android/api-level.h>
803
#define __TBB_USE_DLOPEN_REENTRANCY_WORKAROUND (__ANDROID_API__ < 19)
804
#endif
805
806
#define __TBB_ALLOCATOR_CONSTRUCT_VARIADIC (__TBB_CPP11_VARIADIC_TEMPLATES_PRESENT && __TBB_CPP11_RVALUE_REF_PRESENT)
807
808
#define __TBB_VARIADIC_PARALLEL_INVOKE (TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE && __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT && __TBB_CPP11_RVALUE_REF_PRESENT)
809
#define __TBB_FLOW_GRAPH_CPP11_FEATURES (__TBB_CPP11_VARIADIC_TEMPLATES_PRESENT \
810
&& __TBB_CPP11_SMART_POINTERS_PRESENT && __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_AUTO_PRESENT) \
811
&& __TBB_CPP11_VARIADIC_TUPLE_PRESENT && __TBB_CPP11_DEFAULT_FUNC_TEMPLATE_ARGS_PRESENT \
812
&& !__TBB_UPCAST_OF_TUPLE_OF_REF_BROKEN
813
#define __TBB_PREVIEW_STREAMING_NODE (__TBB_CPP11_VARIADIC_FIXED_LENGTH_EXP_PRESENT && __TBB_FLOW_GRAPH_CPP11_FEATURES \
814
&& TBB_PREVIEW_FLOW_GRAPH_NODES && !TBB_IMPLEMENT_CPP0X && !__TBB_UPCAST_OF_TUPLE_OF_REF_BROKEN)
815
#define __TBB_PREVIEW_OPENCL_NODE (__TBB_PREVIEW_STREAMING_NODE && __TBB_CPP11_TEMPLATE_ALIASES_PRESENT)
816
#define __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING (TBB_PREVIEW_FLOW_GRAPH_FEATURES || __TBB_PREVIEW_OPENCL_NODE)
817
#define __TBB_PREVIEW_ASYNC_MSG (TBB_PREVIEW_FLOW_GRAPH_FEATURES && __TBB_FLOW_GRAPH_CPP11_FEATURES)
818
819
820
#ifndef __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
821
#define __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES TBB_PREVIEW_FLOW_GRAPH_FEATURES
822
#endif
823
824
#ifndef __TBB_PREVIEW_CRITICAL_TASKS
825
#define __TBB_PREVIEW_CRITICAL_TASKS (__TBB_CPF_BUILD || __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES)
826
#endif
827
828
#endif
/* __TBB_tbb_config_H */
Copyright © 2005-2019 Intel Corporation. All Rights Reserved.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.