tbb_config.h

00001 /*
00002     Copyright 2005-2012 Intel Corporation.  All Rights Reserved.
00003 
00004     The source code contained or described herein and all documents related
00005     to the source code ("Material") are owned by Intel Corporation or its
00006     suppliers or licensors.  Title to the Material remains with Intel
00007     Corporation or its suppliers and licensors.  The Material is protected
00008     by worldwide copyright laws and treaty provisions.  No part of the
00009     Material may be used, copied, reproduced, modified, published, uploaded,
00010     posted, transmitted, distributed, or disclosed in any way without
00011     Intel's prior express written permission.
00012 
00013     No license under any patent, copyright, trade secret or other
00014     intellectual property right is granted to or conferred upon you by
00015     disclosure or delivery of the Materials, either expressly, by
00016     implication, inducement, estoppel or otherwise.  Any license under such
00017     intellectual property rights must be express and approved by Intel in
00018     writing.
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 #if __clang__
00034 #define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
00035 #endif
00036 
00039 #if (__TBB_GCC_VERSION >= 40400) && !defined(__INTEL_COMPILER)
00040 
00041     #define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
00042 #endif
00043 
00044 
00045 /* Select particular features of C++11 based on compiler version.
00046    ICC 12.1 (Linux), GCC 4.3 and higher, clang 2.9 and higher
00047    set __GXX_EXPERIMENTAL_CXX0X__ in c++11 mode.
00048 
00049    Compilers that mimics other compilers (ICC, clang) must be processed before
00050    compilers they mimic.
00051 
00052    TODO: The following conditions should be extended when new compilers/runtimes
00053    support added.
00054  */
00055 
00056 #if __INTEL_COMPILER
00057     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __VARIADIC_TEMPLATES
00058     #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600) && (__INTEL_COMPILER >= 1200)
00059     #define __TBB_EXCEPTION_PTR_PRESENT 0
00060 #elif __clang__
00061     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00062     #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00063     #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00064 #elif __GNUC__
00065     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00066     #define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00067     #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00068 #elif _MSC_VER
00069     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00070     #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00071     #define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
00072 #else
00073     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00074     #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00075     #define __TBB_EXCEPTION_PTR_PRESENT 0
00076 #endif
00077 
00078 // Work around a bug in MinGW32
00079 #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
00080     #define _GLIBCXX_ATOMIC_BUILTINS_4
00081 #endif
00082 
00083 #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
00084     /* ICC defines __GNUC__ and so is covered */
00085     #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
00086 #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
00087     #define __TBB_DECLSPEC_ALIGN_PRESENT 1
00088 #endif
00089 
00090 /* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become optional */
00091 #if (__TBB_GCC_VERSION >= 40306) && !defined(__INTEL_COMPILER)
00092 
00093     #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
00094 #endif
00095 
00098 #ifndef TBB_USE_DEBUG
00099 #ifdef TBB_DO_ASSERT
00100 #define TBB_USE_DEBUG TBB_DO_ASSERT
00101 #else
00102 #ifdef _DEBUG
00103 #define TBB_USE_DEBUG _DEBUG
00104 #else
00105 #define TBB_USE_DEBUG 0
00106 #endif
00107 #endif /* TBB_DO_ASSERT */
00108 #endif /* TBB_USE_DEBUG */
00109 
00110 #ifndef TBB_USE_ASSERT
00111 #ifdef TBB_DO_ASSERT
00112 #define TBB_USE_ASSERT TBB_DO_ASSERT
00113 #else 
00114 #define TBB_USE_ASSERT TBB_USE_DEBUG
00115 #endif /* TBB_DO_ASSERT */
00116 #endif /* TBB_USE_ASSERT */
00117 
00118 #ifndef TBB_USE_THREADING_TOOLS
00119 #ifdef TBB_DO_THREADING_TOOLS
00120 #define TBB_USE_THREADING_TOOLS TBB_DO_THREADING_TOOLS
00121 #else 
00122 #define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
00123 #endif /* TBB_DO_THREADING_TOOLS */
00124 #endif /* TBB_USE_THREADING_TOOLS */
00125 
00126 #ifndef TBB_USE_PERFORMANCE_WARNINGS
00127 #ifdef TBB_PERFORMANCE_WARNINGS
00128 #define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
00129 #else 
00130 #define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
00131 #endif /* TBB_PEFORMANCE_WARNINGS */
00132 #endif /* TBB_USE_PERFORMANCE_WARNINGS */
00133 
00134 
00135 #if !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) && !defined(__SUNPRO_CC) || defined(_XBOX)
00136     #if TBB_USE_EXCEPTIONS
00137         #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00138     #elif !defined(TBB_USE_EXCEPTIONS)
00139         #define TBB_USE_EXCEPTIONS 0
00140     #endif
00141 #elif !defined(TBB_USE_EXCEPTIONS)
00142     #define TBB_USE_EXCEPTIONS 1
00143 #endif
00144 
00145 #ifndef TBB_IMPLEMENT_CPP0X
00146 
00147     #if __GNUC__==4 && __GNUC_MINOR__>=4 && __GXX_EXPERIMENTAL_CXX0X__
00148         #define TBB_IMPLEMENT_CPP0X 0
00149     #else
00150         #define TBB_IMPLEMENT_CPP0X 1
00151     #endif
00152 #endif /* TBB_IMPLEMENT_CPP0X */
00153 
00154 #ifndef TBB_USE_CAPTURED_EXCEPTION
00155     #if __TBB_EXCEPTION_PTR_PRESENT
00156         #define TBB_USE_CAPTURED_EXCEPTION 0
00157     #else
00158         #define TBB_USE_CAPTURED_EXCEPTION 1
00159     #endif
00160 #else /* defined TBB_USE_CAPTURED_EXCEPTION */
00161     #if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
00162         #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.
00163     #endif
00164 #endif /* defined TBB_USE_CAPTURED_EXCEPTION */
00165 
00167 #if (TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT)
00168     #error "GCC atomic built-ins are not supported."
00169 #endif
00170 
00178 #ifndef __TBB_DYNAMIC_LOAD_ENABLED
00179     #define __TBB_DYNAMIC_LOAD_ENABLED 1
00180 #elif !(_WIN32||_WIN64) && !__TBB_DYNAMIC_LOAD_ENABLED
00181     #define __TBB_WEAK_SYMBOLS 1
00182 #endif
00183 
00184 #if (_WIN32||_WIN64) && __TBB_SOURCE_DIRECTLY_INCLUDED
00185     #define __TBB_NO_IMPLICIT_LINKAGE 1
00186     #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
00187 #endif
00188 
00189 #ifndef __TBB_COUNT_TASK_NODES
00190     #define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
00191 #endif
00192 
00193 #ifndef __TBB_TASK_GROUP_CONTEXT
00194     #define __TBB_TASK_GROUP_CONTEXT 1
00195 #endif /* __TBB_TASK_GROUP_CONTEXT */
00196 
00197 #if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
00198     #error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
00199 #endif
00200 
00201 #ifndef __TBB_SCHEDULER_OBSERVER
00202     #define __TBB_SCHEDULER_OBSERVER 1
00203 #endif /* __TBB_SCHEDULER_OBSERVER */
00204 
00205 #ifndef __TBB_TASK_PRIORITY
00206     #define __TBB_TASK_PRIORITY __TBB_TASK_GROUP_CONTEXT
00207 #endif /* __TBB_TASK_PRIORITY */
00208 
00209 #if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
00210     #error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
00211 #endif
00212 
00213 #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && (_WIN32 || _WIN64 || __linux__)
00214     #define __TBB_SURVIVE_THREAD_SWITCH 1
00215 #endif /* __TBB_SURVIVE_THREAD_SWITCH */
00216 
00217 #ifndef __TBB_DEFAULT_PARTITIONER
00218 #if TBB_DEPRECATED
00219 
00220 #define __TBB_DEFAULT_PARTITIONER tbb::simple_partitioner
00221 #else
00222 
00223 #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
00224 #endif /* TBB_DEPRECATED */
00225 #endif /* !defined(__TBB_DEFAULT_PARTITIONER */
00226 
00233 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
00234     #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
00235 #endif
00236 
00237 #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
00238 
00241     #define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
00242 #endif
00243 
00244 #if defined(_MSC_VER) && _MSC_VER < 1500 && !defined(__INTEL_COMPILER)
00245 
00247     #define __TBB_TEMPLATE_FRIENDS_BROKEN 1
00248 #endif
00249 
00250 #if __GLIBC__==2 && __GLIBC_MINOR__==3 || __MINGW32__ || (__APPLE__ && __INTEL_COMPILER==1200 && !TBB_USE_DEBUG)
00252 
00253     #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
00254 #endif
00255 
00256 #if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
00257 
00258     #define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
00259 #endif
00260 
00261 #if __clang__ || (__GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER))
00262 
00263     #define __TBB_PROTECTED_NESTED_CLASS_BROKEN 1
00264 #endif
00265 
00266 #if __MINGW32__ && (__GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<2)
00267 
00269     #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
00270 #endif
00271 
00272 #if __GNUC__==4 && __GNUC_MINOR__==3 && __GNUC_PATCHLEVEL__==0
00273     // GCC of this version may rashly ignore control dependencies
00274     #define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
00275 #endif
00276 
00277 #if __FreeBSD__
00278 
00280     #define __TBB_PRIO_INHERIT_BROKEN 1
00281 
00284     #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
00285 #endif /* __FreeBSD__ */
00286 
00287 #if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
00288 
00290     #define __TBB_ICC_ASM_VOLATILE_BROKEN 1
00291 #endif
00292 
00293 #if !__INTEL_COMPILER && (_MSC_VER || __GNUC__==3 && __GNUC_MINOR__<=2)
00294 
00296     #define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
00297 #endif
00298 
00299 #if __INTEL_COMPILER
00300     #define __TBB_CPP11_STD_FORWARD_BROKEN 1
00301 #else
00302     #define __TBB_CPP11_STD_FORWARD_BROKEN 0
00303 #endif
00304 
00305 #endif /* __TBB_tbb_config_H */

Copyright © 2005-2012 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.