00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __TBB_tbb_config_H
00022 #define __TBB_tbb_config_H
00023
00032 #define __TBB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
00033
00034 #if __clang__
00035 #define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
00036 #endif
00037
00040 #if __INTEL_COMPILER == 9999 && __INTEL_COMPILER_BUILD_DATE == 20110811
00041
00042 #undef __INTEL_COMPILER
00043 #define __INTEL_COMPILER 1210
00044 #endif
00045
00046 #if (__TBB_GCC_VERSION >= 40400) && !defined(__INTEL_COMPILER)
00047
00048 #define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
00049 #endif
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #if __INTEL_COMPILER
00063
00066 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __VARIADIC_TEMPLATES
00067 #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600) && (__INTEL_COMPILER >= 1200)
00068 #if _MSC_VER >= 1600
00069 #define __TBB_EXCEPTION_PTR_PRESENT __INTEL_COMPILER > 1300 \
00070 \
00071 || (__INTEL_COMPILER == 1300 && __INTEL_COMPILER_BUILD_DATE >= 20120530) \
00072 || (__INTEL_COMPILER == 1210 && __INTEL_COMPILER_BUILD_DATE >= 20120410)
00073
00074 #elif (__TBB_GCC_VERSION >= 40404) && (__TBB_GCC_VERSION < 40600)
00075 #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1200
00076 #else
00077 #define __TBB_EXCEPTION_PTR_PRESENT 0
00078 #endif
00079 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700 || (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600))
00080 #define __TBB_STATIC_ASSERT_PRESENT __GXX_EXPERIMENTAL_CXX0X__ || (_MSC_VER >= 1600)
00081 #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600) || ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00082
00083 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00084 #elif __clang__
00085
00086 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00087 #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00088 #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00089 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION > 30100)// TODO: check version
00090 #define __TBB_STATIC_ASSERT_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00091 #define __TBB_CPP11_TUPLE_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00092 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00093 #elif __GNUC__
00094 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00095 #define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00096
00099 #define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && (__TBB_GCC_VERSION >= 40404) && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00100 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600)
00101 #define __TBB_STATIC_ASSERT_PRESENT ((__TBB_GCC_VERSION >= 40300) && (__GXX_EXPERIMENTAL_CXX0X__))
00102 #define __TBB_CPP11_TUPLE_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40300))
00103 #define __TBB_INITIALIZER_LISTS_PRESENT ((__GXX_EXPERIMENTAL_CXX0X__) && (__TBB_GCC_VERSION >= 40400))
00104 #elif _MSC_VER
00105 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00106 #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00107 #define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
00108 #define __TBB_STATIC_ASSERT_PRESENT (_MSC_VER >= 1600)
00109 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700)
00110 #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600)
00111 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00112 #else
00113 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00114 #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00115 #define __TBB_EXCEPTION_PTR_PRESENT 0
00116 #define __TBB_STATIC_ASSERT_PRESENT 0
00117 #define __TBB_MAKE_EXCEPTION_PTR_PRESENT 0
00118 #define __TBB_CPP11_TUPLE_PRESENT 0
00119 #define __TBB_INITIALIZER_LISTS_PRESENT 0
00120 #endif
00121
00122
00123
00124 #if __INTEL_COMPILER && __GNUC__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00125 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
00126 #endif
00127
00128
00129 #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
00130 #define _GLIBCXX_ATOMIC_BUILTINS_4
00131 #endif
00132
00133 #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
00134
00135 #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
00136 #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
00137 #define __TBB_DECLSPEC_ALIGN_PRESENT 1
00138 #endif
00139
00140
00141
00142
00143 #if (__TBB_GCC_VERSION >= 40306) || (__INTEL_COMPILER >= 1200)
00144
00145 #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
00146 #endif
00147
00148 #if (__INTEL_COMPILER >= 1210)
00149
00150 #define __TBB_ICC_BUILTIN_ATOMICS_PRESENT 1
00151 #endif
00152
00155 #ifndef TBB_USE_DEBUG
00156 #ifdef TBB_DO_ASSERT
00157 #define TBB_USE_DEBUG TBB_DO_ASSERT
00158 #else
00159 #ifdef _DEBUG
00160 #define TBB_USE_DEBUG _DEBUG
00161 #else
00162 #define TBB_USE_DEBUG 0
00163 #endif
00164 #endif
00165 #endif
00166
00167 #ifndef TBB_USE_ASSERT
00168 #ifdef TBB_DO_ASSERT
00169 #define TBB_USE_ASSERT TBB_DO_ASSERT
00170 #else
00171 #define TBB_USE_ASSERT TBB_USE_DEBUG
00172 #endif
00173 #endif
00174
00175 #ifndef TBB_USE_THREADING_TOOLS
00176 #ifdef TBB_DO_THREADING_TOOLS
00177 #define TBB_USE_THREADING_TOOLS TBB_DO_THREADING_TOOLS
00178 #else
00179 #define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
00180 #endif
00181 #endif
00182
00183 #ifndef TBB_USE_PERFORMANCE_WARNINGS
00184 #ifdef TBB_PERFORMANCE_WARNINGS
00185 #define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
00186 #else
00187 #define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
00188 #endif
00189 #endif
00190
00191 #if __MIC__ || __MIC2__
00192 #define __TBB_DEFINE_MIC 1
00193 #endif
00194
00195 #if !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) && !defined(__SUNPRO_CC) || defined(_XBOX)
00196 #if TBB_USE_EXCEPTIONS
00197 #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00198 #elif !defined(TBB_USE_EXCEPTIONS)
00199 #define TBB_USE_EXCEPTIONS 0
00200 #endif
00201 #elif !defined(TBB_USE_EXCEPTIONS)
00202 #if __TBB_DEFINE_MIC
00203 #define TBB_USE_EXCEPTIONS 0
00204 #else
00205 #define TBB_USE_EXCEPTIONS 1
00206 #endif
00207 #elif TBB_USE_EXCEPTIONS && __TBB_DEFINE_MIC
00208 #error Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00209 #endif
00210
00211 #ifndef TBB_IMPLEMENT_CPP0X
00212
00213 #if __GNUC__==4 && __GNUC_MINOR__>=4 && __GXX_EXPERIMENTAL_CXX0X__
00214 #define TBB_IMPLEMENT_CPP0X 0
00215 #else
00216 #define TBB_IMPLEMENT_CPP0X 1
00217 #endif
00218 #endif
00219
00220
00221 #ifndef TBB_USE_CAPTURED_EXCEPTION
00222
00223 #if __TBB_EXCEPTION_PTR_PRESENT && !defined(__GNUC__)
00224 #define TBB_USE_CAPTURED_EXCEPTION 0
00225 #else
00226 #define TBB_USE_CAPTURED_EXCEPTION 1
00227 #endif
00228 #else
00229 #if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
00230 #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.
00231 #endif
00232 #endif
00233
00235 #if (TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT)
00236 #error "GCC atomic built-ins are not supported."
00237 #endif
00238
00242 #define __TBB_WEAK_SYMBOLS_PRESENT !_WIN32 && !__APPLE__ && !__sun && ((__TBB_GCC_VERSION >= 40000) || defined(__INTEL_COMPILER))
00243
00245 #ifndef __TBB_DYNAMIC_LOAD_ENABLED
00246 #define __TBB_DYNAMIC_LOAD_ENABLED 1
00247 #endif
00248
00252 #if (_WIN32||_WIN64) && __TBB_SOURCE_DIRECTLY_INCLUDED
00253 #define __TBB_NO_IMPLICIT_LINKAGE 1
00254 #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
00255 #endif
00256
00257 #ifndef __TBB_COUNT_TASK_NODES
00258 #define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
00259 #endif
00260
00261 #ifndef __TBB_TASK_GROUP_CONTEXT
00262 #define __TBB_TASK_GROUP_CONTEXT 1
00263 #endif
00264
00265 #ifndef __TBB_SCHEDULER_OBSERVER
00266 #define __TBB_SCHEDULER_OBSERVER 1
00267 #endif
00268
00269 #if !defined(TBB_PREVIEW_TASK_ARENA) && __TBB_BUILD
00270 #define TBB_PREVIEW_TASK_ARENA __TBB_CPF_BUILD
00271 #endif
00272 #define __TBB_TASK_ARENA TBB_PREVIEW_TASK_ARENA
00273 #if TBB_PREVIEW_TASK_ARENA
00274 #define TBB_PREVIEW_LOCAL_OBSERVER 1
00275 #define __TBB_NO_IMPLICIT_LINKAGE 1
00276 #define __TBB_TASK_PRIORITY 0 // TODO: it will be removed in next versions
00277 #if !__TBB_SCHEDULER_OBSERVER
00278 #error TBB_PREVIEW_TASK_ARENA requires __TBB_SCHEDULER_OBSERVER to be enabled
00279 #endif
00280 #endif
00281
00282 #if !defined(TBB_PREVIEW_LOCAL_OBSERVER) && __TBB_BUILD && __TBB_SCHEDULER_OBSERVER
00283 #define TBB_PREVIEW_LOCAL_OBSERVER 1
00284 #endif
00285
00286 #if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
00287 #error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
00288 #endif
00289
00290 #ifndef __TBB_TASK_PRIORITY
00291 #define __TBB_TASK_PRIORITY __TBB_TASK_GROUP_CONTEXT
00292 #endif
00293
00294 #if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
00295 #error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
00296 #endif
00297
00298 #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && \
00299 (_WIN32 || _WIN64 || __APPLE__ || (__linux__ && !__ANDROID__))
00300 #define __TBB_SURVIVE_THREAD_SWITCH 1
00301 #endif
00302
00303 #ifndef __TBB_DEFAULT_PARTITIONER
00304 #if TBB_DEPRECATED
00305
00306 #define __TBB_DEFAULT_PARTITIONER tbb::simple_partitioner
00307 #else
00308
00309 #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
00310 #endif
00311 #endif
00312
00313 #ifdef _VARIADIC_MAX
00314 #define __TBB_VARIADIC_MAX _VARIADIC_MAX
00315 #else
00316 #if _MSC_VER >= 1700
00317 #define __TBB_VARIADIC_MAX 5
00318 #else
00319 #define __TBB_VARIADIC_MAX 10
00320 #endif
00321 #endif
00322
00329 #if __ANDROID__ && __TBB_GCC_VERSION <= 40403 && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
00330
00333 #define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
00334 #endif
00335
00336 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
00337 #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
00338 #endif
00339
00340 #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
00341
00344 #define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
00345 #endif
00346
00347 #if defined(_MSC_VER) && _MSC_VER < 1500 && !defined(__INTEL_COMPILER)
00348
00350 #define __TBB_TEMPLATE_FRIENDS_BROKEN 1
00351 #endif
00352
00353 #if __GLIBC__==2 && __GLIBC_MINOR__==3 || __MINGW32__ || (__APPLE__ && __INTEL_COMPILER==1200 && !TBB_USE_DEBUG)
00354
00356 #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
00357 #else
00358 #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 0
00359 #endif
00360
00361 #if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
00362
00363 #define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
00364 #endif
00365
00366 #if __clang__ || (__GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER))
00367
00368 #define __TBB_PROTECTED_NESTED_CLASS_BROKEN 1
00369 #endif
00370
00371 #if __MINGW32__ && (__GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<2)
00372
00374 #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
00375 #else
00376 #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 0
00377 #endif
00378
00379 #if __GNUC__==4 && __GNUC_MINOR__==3 && __GNUC_PATCHLEVEL__==0
00380
00381 #define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
00382 #endif
00383
00384 #if __FreeBSD__
00385
00387 #define __TBB_PRIO_INHERIT_BROKEN 1
00388
00391 #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
00392 #endif
00393
00394 #if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
00395
00397 #define __TBB_ICC_ASM_VOLATILE_BROKEN 1
00398 #endif
00399
00400 #if !__INTEL_COMPILER && (_MSC_VER || __GNUC__==3 && __GNUC_MINOR__<=2)
00401
00403 #define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
00404 #endif
00405
00406 #if __INTEL_COMPILER
00407 #define __TBB_CPP11_STD_FORWARD_BROKEN 1
00408 #else
00409 #define __TBB_CPP11_STD_FORWARD_BROKEN 0
00410 #endif
00411
00412 #if __TBB_DEFINE_MIC
00413
00414 #define __TBB_MAIN_THREAD_AFFINITY_BROKEN 1
00415 #endif
00416
00417 #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
00418 #define __TBB_WIN8UI_SUPPORT 1
00419 #else
00420 #define __TBB_WIN8UI_SUPPORT 0
00421 #endif
00422
00423 #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__)
00424
00425
00426
00427
00428 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 1
00429 #else
00430 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 0
00431 #endif
00432
00433 #endif