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 
00036 #if (__TBB_GCC_VERSION >= 40400) && !defined(__INTEL_COMPILER)
00037 
00038     #define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
00039 #endif
00040 
00041 /* TODO: The following condition should be extended when new compilers/runtimes 
00042          with std::exception_ptr support appear. */
00043 #define __TBB_EXCEPTION_PTR_PRESENT  ((_MSC_VER >= 1600 || (__GXX_EXPERIMENTAL_CXX0X__ && __GNUC__==4 && __GNUC_MINOR__>=4)) && !__INTEL_COMPILER)
00044 
00045 #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
00046     /* ICC defines __GNUC__ and so is covered */
00047     #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
00048 #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
00049     #define __TBB_DECLSPEC_ALIGN_PRESENT 1
00050 #endif
00051 
00052 /* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become optional */
00053 #if (__TBB_GCC_VERSION >= 40306) && !defined(__INTEL_COMPILER)
00054 
00055     #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
00056 #endif
00057 
00060 #ifndef TBB_USE_DEBUG
00061 #ifdef TBB_DO_ASSERT
00062 #define TBB_USE_DEBUG TBB_DO_ASSERT
00063 #else
00064 #ifdef _DEBUG
00065 #define TBB_USE_DEBUG _DEBUG
00066 #else
00067 #define TBB_USE_DEBUG 0
00068 #endif
00069 #endif /* TBB_DO_ASSERT */
00070 #endif /* TBB_USE_DEBUG */
00071 
00072 #ifndef TBB_USE_ASSERT
00073 #ifdef TBB_DO_ASSERT
00074 #define TBB_USE_ASSERT TBB_DO_ASSERT
00075 #else 
00076 #define TBB_USE_ASSERT TBB_USE_DEBUG
00077 #endif /* TBB_DO_ASSERT */
00078 #endif /* TBB_USE_ASSERT */
00079 
00080 #ifndef TBB_USE_THREADING_TOOLS
00081 #ifdef TBB_DO_THREADING_TOOLS
00082 #define TBB_USE_THREADING_TOOLS TBB_DO_THREADING_TOOLS
00083 #else 
00084 #define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
00085 #endif /* TBB_DO_THREADING_TOOLS */
00086 #endif /* TBB_USE_THREADING_TOOLS */
00087 
00088 #ifndef TBB_USE_PERFORMANCE_WARNINGS
00089 #ifdef TBB_PERFORMANCE_WARNINGS
00090 #define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
00091 #else 
00092 #define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
00093 #endif /* TBB_PEFORMANCE_WARNINGS */
00094 #endif /* TBB_USE_PERFORMANCE_WARNINGS */
00095 
00096 
00097 #if !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) && !defined(__SUNPRO_CC) || defined(_XBOX)
00098     #if TBB_USE_EXCEPTIONS
00099         #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00100     #elif !defined(TBB_USE_EXCEPTIONS)
00101         #define TBB_USE_EXCEPTIONS 0
00102     #endif
00103 #elif !defined(TBB_USE_EXCEPTIONS)
00104     #define TBB_USE_EXCEPTIONS 1
00105 #endif
00106 
00107 #ifndef TBB_IMPLEMENT_CPP0X
00108 
00109     #if __GNUC__==4 && __GNUC_MINOR__>=4 && __GXX_EXPERIMENTAL_CXX0X__
00110         #define TBB_IMPLEMENT_CPP0X 0
00111     #else
00112         #define TBB_IMPLEMENT_CPP0X 1
00113     #endif
00114 #endif /* TBB_IMPLEMENT_CPP0X */
00115 
00116 #ifndef TBB_USE_CAPTURED_EXCEPTION
00117     #if __TBB_EXCEPTION_PTR_PRESENT
00118         #define TBB_USE_CAPTURED_EXCEPTION 0
00119     #else
00120         #define TBB_USE_CAPTURED_EXCEPTION 1
00121     #endif
00122 #else /* defined TBB_USE_CAPTURED_EXCEPTION */
00123     #if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
00124         #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.
00125     #endif
00126 #endif /* defined TBB_USE_CAPTURED_EXCEPTION */
00127 
00129 #if (TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT)
00130     #error "GCC atomic built-ins are not supported."
00131 #endif
00132 
00135 #ifndef __TBB_DYNAMIC_LOAD_ENABLED
00136     #define __TBB_DYNAMIC_LOAD_ENABLED !__TBB_TASK_CPP_DIRECTLY_INCLUDED
00137 #elif !__TBB_DYNAMIC_LOAD_ENABLED
00138     #if _WIN32||_WIN64
00139         #define __TBB_NO_IMPLICIT_LINKAGE 1
00140         #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
00141     #else
00142         #define __TBB_WEAK_SYMBOLS 1
00143     #endif
00144 #endif
00145 
00146 #ifndef __TBB_COUNT_TASK_NODES
00147     #define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
00148 #endif
00149 
00150 #ifndef __TBB_TASK_GROUP_CONTEXT
00151     #define __TBB_TASK_GROUP_CONTEXT 1
00152 #endif /* __TBB_TASK_GROUP_CONTEXT */
00153 
00154 #if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
00155     #error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
00156 #endif
00157 
00158 #ifndef __TBB_SCHEDULER_OBSERVER
00159     #define __TBB_SCHEDULER_OBSERVER 1
00160 #endif /* __TBB_SCHEDULER_OBSERVER */
00161 
00162 #ifndef __TBB_TASK_PRIORITY
00163     #define __TBB_TASK_PRIORITY __TBB_TASK_GROUP_CONTEXT
00164 #endif /* __TBB_TASK_PRIORITY */
00165 
00166 #if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
00167     #error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
00168 #endif
00169 
00170 #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && (_WIN32 || _WIN64 || __linux__)
00171     #define __TBB_SURVIVE_THREAD_SWITCH 1
00172 #endif /* __TBB_SURVIVE_THREAD_SWITCH */
00173 
00174 #ifndef __TBB_DEFAULT_PARTITIONER
00175 #if TBB_DEPRECATED
00176 
00177 #define __TBB_DEFAULT_PARTITIONER tbb::simple_partitioner
00178 #else
00179 
00180 #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
00181 #endif /* TBB_DEPRECATED */
00182 #endif /* !defined(__TBB_DEFAULT_PARTITIONER */
00183 
00190 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
00191     #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
00192 #endif
00193 
00194 #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
00195 
00198     #define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
00199 #endif
00200 
00201 #if defined(_MSC_VER) && _MSC_VER < 1500 && !defined(__INTEL_COMPILER)
00202 
00204     #define __TBB_TEMPLATE_FRIENDS_BROKEN 1
00205 #endif
00206 
00207 #if __GLIBC__==2 && __GLIBC_MINOR__==3 || __MINGW32__ || (__APPLE__ && __INTEL_COMPILER==1200 && !TBB_USE_DEBUG)
00209 
00210     #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
00211 #endif
00212 
00213 #if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
00214 
00215     #define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
00216 #endif
00217 
00218 #if __GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER)
00219 
00220     #define __TBB_GCC_3_3_PROTECTED_BROKEN 1
00221 #endif
00222 
00223 #if __MINGW32__ && (__GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<2)
00224 
00226     #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
00227 #endif
00228 
00229 #if __GNUC__==4 && __GNUC_MINOR__==3 && __GNUC_PATCHLEVEL__==0
00230     // GCC of this version may rashly ignore control dependencies
00231     #define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
00232 #endif
00233 
00234 #if __FreeBSD__
00235 
00237     #define __TBB_PRIO_INHERIT_BROKEN 1
00238 
00241     #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
00242 #endif /* __FreeBSD__ */
00243 
00244 #if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
00245 
00247     #define __TBB_ICC_ASM_VOLATILE_BROKEN 1
00248 #endif
00249 
00250 #if !__INTEL_COMPILER && (_MSC_VER || __GNUC__==3 && __GNUC_MINOR__<=2)
00251 
00253     #define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
00254 #endif
00255 
00256 #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.