00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __TBB_tbb_config_H
00030 #define __TBB_tbb_config_H
00031
00040 #define __TBB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
00041
00042 #if __clang__
00043 #define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
00044 #endif
00045
00048 #if __INTEL_COMPILER == 9999 && __INTEL_COMPILER_BUILD_DATE == 20110811
00049
00050 #undef __INTEL_COMPILER
00051 #define __INTEL_COMPILER 1210
00052 #endif
00053
00054 #if (__TBB_GCC_VERSION >= 40400) && !defined(__INTEL_COMPILER)
00055
00056 #define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
00057 #endif
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #if __INTEL_COMPILER
00071
00074 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __VARIADIC_TEMPLATES
00075 #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600) && (__INTEL_COMPILER >= 1200)
00076 #if _MSC_VER >= 1600
00077 #define __TBB_EXCEPTION_PTR_PRESENT __INTEL_COMPILER > 1300 \
00078 \
00079 || (__INTEL_COMPILER == 1300 && __INTEL_COMPILER_BUILD_DATE >= 20120530) \
00080 || (__INTEL_COMPILER == 1210 && __INTEL_COMPILER_BUILD_DATE >= 20120410)
00081
00082 #elif (__TBB_GCC_VERSION >= 40404) && (__TBB_GCC_VERSION < 40600)
00083 #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1200
00084 #else
00085 #define __TBB_EXCEPTION_PTR_PRESENT 0
00086 #endif
00087 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700 || (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600))
00088 #define __TBB_STATIC_ASSERT_PRESENT __GXX_EXPERIMENTAL_CXX0X__ || (_MSC_VER >= 1600)
00089 #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600) || ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00090
00091 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00092 #define __TBB_CONSTEXPR_PRESENT 0
00093 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0
00094 #elif __clang__
00095
00096 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00097 #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00098 #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00099 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION > 30100)// TODO: check version
00100 #define __TBB_STATIC_ASSERT_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00101 #define __TBB_CPP11_TUPLE_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00102 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00103 #define __TBB_CONSTEXPR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION > 30100)
00104 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0
00105 #elif __GNUC__
00106 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00107 #define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00108
00111 #define __TBB_EXCEPTION_PTR_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40404) && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00112 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40600))
00113 #define __TBB_STATIC_ASSERT_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00114 #define __TBB_CPP11_TUPLE_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00115 #define __TBB_INITIALIZER_LISTS_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40400))
00116
00117 #define __TBB_CONSTEXPR_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40400))
00118 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40400))
00119 #elif _MSC_VER
00120 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00121 #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00122 #define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
00123 #define __TBB_STATIC_ASSERT_PRESENT (_MSC_VER >= 1600)
00124 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700)
00125 #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600)
00126 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00127 #define __TBB_CONSTEXPR_PRESENT 0
00128 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0
00129 #else
00130 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00131 #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00132 #define __TBB_EXCEPTION_PTR_PRESENT 0
00133 #define __TBB_STATIC_ASSERT_PRESENT 0
00134 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT 0
00135 #define __TBB_CPP11_TUPLE_PRESENT 0
00136 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00137 #define __TBB_CONSTEXPR_PRESENT 0
00138 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0
00139 #endif
00140
00141
00142
00143 #if __INTEL_COMPILER && __GNUC__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00144 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
00145 #endif
00146
00147
00148 #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
00149 #define _GLIBCXX_ATOMIC_BUILTINS_4
00150 #endif
00151
00152 #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
00153
00154 #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
00155 #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
00156 #define __TBB_DECLSPEC_ALIGN_PRESENT 1
00157 #endif
00158
00159
00160
00161
00162 #if (__TBB_GCC_VERSION >= 40306) || (__INTEL_COMPILER >= 1200)
00163
00164 #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
00165 #endif
00166
00167 #if (__INTEL_COMPILER >= 1210)
00168
00169 #define __TBB_ICC_BUILTIN_ATOMICS_PRESENT 1
00170 #endif
00171
00174 #ifndef TBB_USE_DEBUG
00175 #ifdef TBB_DO_ASSERT
00176 #define TBB_USE_DEBUG TBB_DO_ASSERT
00177 #else
00178 #ifdef _DEBUG
00179 #define TBB_USE_DEBUG _DEBUG
00180 #else
00181 #define TBB_USE_DEBUG 0
00182 #endif
00183 #endif
00184 #endif
00185
00186 #ifndef TBB_USE_ASSERT
00187 #ifdef TBB_DO_ASSERT
00188 #define TBB_USE_ASSERT TBB_DO_ASSERT
00189 #else
00190 #define TBB_USE_ASSERT TBB_USE_DEBUG
00191 #endif
00192 #endif
00193
00194 #ifndef TBB_USE_THREADING_TOOLS
00195 #ifdef TBB_DO_THREADING_TOOLS
00196 #define TBB_USE_THREADING_TOOLS TBB_DO_THREADING_TOOLS
00197 #else
00198 #define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
00199 #endif
00200 #endif
00201
00202 #ifndef TBB_USE_PERFORMANCE_WARNINGS
00203 #ifdef TBB_PERFORMANCE_WARNINGS
00204 #define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
00205 #else
00206 #define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
00207 #endif
00208 #endif
00209
00210 #if __MIC__ || __MIC2__
00211 #define __TBB_DEFINE_MIC 1
00212 #endif
00213
00214 #if !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) && !defined(__SUNPRO_CC) || defined(_XBOX)
00215 #if TBB_USE_EXCEPTIONS
00216 #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00217 #elif !defined(TBB_USE_EXCEPTIONS)
00218 #define TBB_USE_EXCEPTIONS 0
00219 #endif
00220 #elif !defined(TBB_USE_EXCEPTIONS)
00221 #if __TBB_DEFINE_MIC
00222 #define TBB_USE_EXCEPTIONS 0
00223 #else
00224 #define TBB_USE_EXCEPTIONS 1
00225 #endif
00226 #elif TBB_USE_EXCEPTIONS && __TBB_DEFINE_MIC
00227 #error Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00228 #endif
00229
00230 #ifndef TBB_IMPLEMENT_CPP0X
00231
00232 #if __GNUC__==4 && __GNUC_MINOR__>=4 && __GXX_EXPERIMENTAL_CXX0X__
00233 #define TBB_IMPLEMENT_CPP0X 0
00234 #else
00235 #define TBB_IMPLEMENT_CPP0X 1
00236 #endif
00237 #endif
00238
00239
00240 #ifndef TBB_USE_CAPTURED_EXCEPTION
00241
00242 #if __TBB_EXCEPTION_PTR_PRESENT && !defined(__GNUC__)
00243 #define TBB_USE_CAPTURED_EXCEPTION 0
00244 #else
00245 #define TBB_USE_CAPTURED_EXCEPTION 1
00246 #endif
00247 #else
00248 #if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
00249 #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.
00250 #endif
00251 #endif
00252
00254 #if (TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT)
00255 #error "GCC atomic built-ins are not supported."
00256 #endif
00257
00261 #define __TBB_WEAK_SYMBOLS_PRESENT !_WIN32 && !__APPLE__ && !__sun && ((__TBB_GCC_VERSION >= 40000) || defined(__INTEL_COMPILER))
00262
00264 #ifndef __TBB_DYNAMIC_LOAD_ENABLED
00265 #define __TBB_DYNAMIC_LOAD_ENABLED 1
00266 #endif
00267
00271 #if (_WIN32||_WIN64) && __TBB_SOURCE_DIRECTLY_INCLUDED
00272 #define __TBB_NO_IMPLICIT_LINKAGE 1
00273 #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
00274 #endif
00275
00276 #ifndef __TBB_COUNT_TASK_NODES
00277 #define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
00278 #endif
00279
00280 #ifndef __TBB_TASK_GROUP_CONTEXT
00281 #define __TBB_TASK_GROUP_CONTEXT 1
00282 #endif
00283
00284 #ifndef __TBB_SCHEDULER_OBSERVER
00285 #define __TBB_SCHEDULER_OBSERVER 1
00286 #endif
00287
00288 #if !defined(TBB_PREVIEW_TASK_ARENA) && __TBB_BUILD
00289 #define TBB_PREVIEW_TASK_ARENA __TBB_CPF_BUILD
00290 #endif
00291 #define __TBB_TASK_ARENA TBB_PREVIEW_TASK_ARENA
00292 #if TBB_PREVIEW_TASK_ARENA
00293 #define TBB_PREVIEW_LOCAL_OBSERVER 1
00294 #define __TBB_NO_IMPLICIT_LINKAGE 1
00295 #define __TBB_TASK_PRIORITY 0 // TODO: it will be removed in next versions
00296 #if !__TBB_SCHEDULER_OBSERVER
00297 #error TBB_PREVIEW_TASK_ARENA requires __TBB_SCHEDULER_OBSERVER to be enabled
00298 #endif
00299 #endif
00300
00301 #if !defined(TBB_PREVIEW_LOCAL_OBSERVER) && __TBB_BUILD && __TBB_SCHEDULER_OBSERVER
00302 #define TBB_PREVIEW_LOCAL_OBSERVER 1
00303 #endif
00304
00305 #if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
00306 #error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
00307 #endif
00308
00309 #ifndef __TBB_TASK_PRIORITY
00310 #define __TBB_TASK_PRIORITY __TBB_TASK_GROUP_CONTEXT
00311 #endif
00312
00313 #if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
00314 #error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
00315 #endif
00316
00317 #if TBB_PREVIEW_WAITING_FOR_WORKERS || __TBB_BUILD
00318 #define __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE 1
00319 #endif
00320
00321 #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && \
00322 (_WIN32 || _WIN64 || __APPLE__ || (__linux__ && !__ANDROID__))
00323 #define __TBB_SURVIVE_THREAD_SWITCH 1
00324 #endif
00325
00326 #ifndef __TBB_DEFAULT_PARTITIONER
00327 #if TBB_DEPRECATED
00328
00329 #define __TBB_DEFAULT_PARTITIONER tbb::simple_partitioner
00330 #else
00331
00332 #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
00333 #endif
00334 #endif
00335
00336 #ifdef _VARIADIC_MAX
00337 #define __TBB_VARIADIC_MAX _VARIADIC_MAX
00338 #else
00339 #if _MSC_VER >= 1700
00340 #define __TBB_VARIADIC_MAX 5
00341 #else
00342 #define __TBB_VARIADIC_MAX 10
00343 #endif
00344 #endif
00345
00346
00347 #if _WIN32||_WIN64
00348 # if defined(_M_X64)||defined(__x86_64__) // the latter for MinGW support
00349 # define __TBB_x86_64 1
00350 # elif defined(_M_IA64)
00351 # define __TBB_ipf 1
00352 # elif defined(_M_IX86)||defined(__i386__) // the latter for MinGW support
00353 # define __TBB_x86_32 1
00354 # endif
00355 #else
00356 # if !__linux__ && !__APPLE__
00357 # define __TBB_generic_os 1
00358 # endif
00359 # if __x86_64__
00360 # define __TBB_x86_64 1
00361 # elif __ia64__
00362 # define __TBB_ipf 1
00363 # elif __i386__||__i386 // __i386 is for Sun OS
00364 # define __TBB_x86_32 1
00365 # else
00366 # define __TBB_generic_arch 1
00367 # endif
00368 #endif
00369
00375 #if __ANDROID__ && __TBB_GCC_VERSION <= 40403 && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
00376
00379 #define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
00380 #endif
00381
00382 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
00383 #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
00384 #endif
00385
00386 #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
00387
00390 #define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
00391 #endif
00392
00393 #if defined(_MSC_VER) && _MSC_VER < 1500 && !defined(__INTEL_COMPILER)
00394
00396 #define __TBB_TEMPLATE_FRIENDS_BROKEN 1
00397 #endif
00398
00399 #if __GLIBC__==2 && __GLIBC_MINOR__==3 || __MINGW32__ || (__APPLE__ && __INTEL_COMPILER==1200 && !TBB_USE_DEBUG)
00400
00402 #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
00403 #else
00404 #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 0
00405 #endif
00406
00407 #if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
00408
00409 #define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
00410 #endif
00411
00412 #if __clang__ || (__GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER))
00413
00414 #define __TBB_PROTECTED_NESTED_CLASS_BROKEN 1
00415 #endif
00416
00417 #if __MINGW32__ && (__GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<2)
00418
00420 #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
00421 #else
00422 #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 0
00423 #endif
00424
00425 #if __GNUC__==4 && __GNUC_MINOR__==3 && __GNUC_PATCHLEVEL__==0
00426
00427 #define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
00428 #endif
00429
00430 #if __FreeBSD__
00431
00433 #define __TBB_PRIO_INHERIT_BROKEN 1
00434
00437 #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
00438 #endif
00439
00440 #if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
00441
00443 #define __TBB_ICC_ASM_VOLATILE_BROKEN 1
00444 #endif
00445
00446 #if !__INTEL_COMPILER && (_MSC_VER || __GNUC__==3 && __GNUC_MINOR__<=2)
00447
00449 #define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
00450 #endif
00451
00452 #if __INTEL_COMPILER
00453 #define __TBB_CPP11_STD_FORWARD_BROKEN 1
00454 #else
00455 #define __TBB_CPP11_STD_FORWARD_BROKEN 0
00456 #endif
00457
00458 #if __TBB_DEFINE_MIC
00459
00460 #define __TBB_MAIN_THREAD_AFFINITY_BROKEN 1
00461 #endif
00462
00465 #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
00466 #define __TBB_WIN8UI_SUPPORT 1
00467 #else
00468 #define __TBB_WIN8UI_SUPPORT 0
00469 #endif
00470
00471 #if !defined(__EXCEPTIONS) && __GNUC__==4 && (__GNUC_MINOR__==4 ||__GNUC_MINOR__==5 || (__INTEL_COMPILER==1300 && __TBB_GCC_VERSION>=40600 && __TBB_GCC_VERSION<=40700)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
00472
00473
00474
00475
00476 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 1
00477 #else
00478 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 0
00479 #endif
00480
00481 #if __TBB_x86_32 && (__linux__ || __APPLE__ || _WIN32 || __sun) && ((defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1300)) || (__GNUC__==3 && __GNUC_MINOR__==3 ) || defined(__SUNPRO_CC))
00482
00483
00484
00485
00486 #define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 1
00487 #else
00488 #define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 0
00489 #endif
00490
00491 #if (__TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT && (__TBB_GCC_VERSION < 40700) && (!defined(__INTEL_COMPILER) && !defined (__clang__)))
00492 #define __TBB_ZERO_INIT_WITH_DEFAULTED_CTOR_BROKEN 1
00493 #endif
00494
00496 #define __TBB_ATOMIC_CTORS (__TBB_CONSTEXPR_PRESENT && __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT && (!__TBB_ZERO_INIT_WITH_DEFAULTED_CTOR_BROKEN))
00497
00498 #endif