00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __TBB_tbb_stddef_H
00022 #define __TBB_tbb_stddef_H
00023
00024
00025 #define TBB_VERSION_MAJOR 4
00026 #define TBB_VERSION_MINOR 0
00027
00028
00029 #define TBB_INTERFACE_VERSION 6003
00030 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000
00031
00032
00033
00034 #define TBB_COMPATIBLE_INTERFACE_VERSION 2
00035
00036 #define __TBB_STRING_AUX(x) #x
00037 #define __TBB_STRING(x) __TBB_STRING_AUX(x)
00038
00039
00040 #if !defined RC_INVOKED
00041
00042
00052
00094
00095 #if _WIN32||_WIN64
00096 # if defined(_M_X64)||defined(__x86_64__) // the latter for MinGW support
00097 # define __TBB_x86_64 1
00098 # elif defined(_M_IA64)
00099 # define __TBB_ipf 1
00100 # elif defined(_M_IX86)||defined(__i386__) // the latter for MinGW support
00101 # define __TBB_x86_32 1
00102 # endif
00103 #else
00104 # if !__linux__ && !__APPLE__
00105 # define __TBB_generic_os 1
00106 # endif
00107 # if __x86_64__
00108 # define __TBB_x86_64 1
00109 # elif __ia64__
00110 # define __TBB_ipf 1
00111 # elif __i386__||__i386 // __i386 is for Sun OS
00112 # define __TBB_x86_32 1
00113 # else
00114 # define __TBB_generic_arch 1
00115 # endif
00116 #endif
00117
00118
00119 #include "tbb_config.h"
00120
00121 #if _MSC_VER >=1400
00122 #define __TBB_EXPORTED_FUNC __cdecl
00123 #define __TBB_EXPORTED_METHOD __thiscall
00124 #else
00125 #define __TBB_EXPORTED_FUNC
00126 #define __TBB_EXPORTED_METHOD
00127 #endif
00128
00129 #include <cstddef>
00130
00131 #if _MSC_VER
00132 #define __TBB_tbb_windef_H
00133 #include "internal/_tbb_windef.h"
00134 #undef __TBB_tbb_windef_H
00135 #endif
00136 #if !defined(_MSC_VER) || _MSC_VER>=1600
00137 #include <stdint.h>
00138 #endif
00139
00141 namespace tbb {
00142
00143 #if _MSC_VER && _MSC_VER<1600
00144 namespace internal {
00145 typedef __int8 int8_t;
00146 typedef __int16 int16_t;
00147 typedef __int32 int32_t;
00148 typedef __int64 int64_t;
00149 typedef unsigned __int8 uint8_t;
00150 typedef unsigned __int16 uint16_t;
00151 typedef unsigned __int32 uint32_t;
00152 typedef unsigned __int64 uint64_t;
00153 }
00154 #else
00155 namespace internal {
00156 using ::int8_t;
00157 using ::int16_t;
00158 using ::int32_t;
00159 using ::int64_t;
00160 using ::uint8_t;
00161 using ::uint16_t;
00162 using ::uint32_t;
00163 using ::uint64_t;
00164 }
00165 #endif
00166
00167 using std::size_t;
00168 using std::ptrdiff_t;
00169
00171 typedef void(*assertion_handler_type)( const char* filename, int line, const char* expression, const char * comment );
00172
00173 #if TBB_USE_ASSERT
00174
00176
00179 #define __TBB_ASSERT(predicate,message) ((predicate)?((void)0):tbb::assertion_failure(__FILE__,__LINE__,#predicate,message))
00180 #define __TBB_ASSERT_EX __TBB_ASSERT
00181
00183 assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler( assertion_handler_type new_handler );
00184
00186
00189 void __TBB_EXPORTED_FUNC assertion_failure( const char* filename, int line, const char* expression, const char* comment );
00190
00191 #else
00192
00194 #define __TBB_ASSERT(predicate,comment) ((void)0)
00196 #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))
00197
00198 #endif
00199
00201
00205 extern "C" int __TBB_EXPORTED_FUNC TBB_runtime_interface_version();
00206
00208
00212 class split {
00213 };
00214
00219 namespace internal {
00220
00222
00225 const size_t NFS_MaxLineSize = 128;
00226
00246 #define __TBB_atomic // intentionally empty, see above
00247
00248 template<class T, int S>
00249 struct padded_base : T {
00250 char pad[NFS_MaxLineSize - sizeof(T) % NFS_MaxLineSize];
00251 };
00252 template<class T> struct padded_base<T, 0> : T {};
00253
00255 template<class T>
00256 struct padded : padded_base<T, sizeof(T)> {};
00257
00259
00261 #define __TBB_offsetof(class_name, member_name) \
00262 ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000)
00263
00265 #define __TBB_get_object_ref(class_name, member_name, member_addr) \
00266 (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name)))
00267
00269 void __TBB_EXPORTED_FUNC handle_perror( int error_code, const char* aux_info );
00270
00271 #if TBB_USE_EXCEPTIONS
00272 #define __TBB_TRY try
00273 #define __TBB_CATCH(e) catch(e)
00274 #define __TBB_THROW(e) throw e
00275 #define __TBB_RETHROW() throw
00276 #else
00277 inline bool __TBB_false() { return false; }
00278 #define __TBB_TRY
00279 #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() )
00280 #define __TBB_THROW(e) ((void)0)
00281 #define __TBB_RETHROW() ((void)0)
00282 #endif
00283
00285 void __TBB_EXPORTED_FUNC runtime_warning( const char* format, ... );
00286
00287 #if TBB_USE_ASSERT
00288 static void* const poisoned_ptr = reinterpret_cast<void*>(-1);
00289
00291 template<typename T>
00292 inline void poison_pointer( T*& p ) { p = reinterpret_cast<T*>(poisoned_ptr); }
00293
00295 template<typename T>
00296 inline bool is_poisoned( T* p ) { return p == reinterpret_cast<T*>(poisoned_ptr); }
00297 #else
00298 template<typename T>
00299 inline void poison_pointer( T* ) {}
00300 #endif
00301
00303
00305 template<typename T, typename U>
00306 inline T punned_cast( U* ptr ) {
00307 uintptr_t x = reinterpret_cast<uintptr_t>(ptr);
00308 return reinterpret_cast<T>(x);
00309 }
00310
00312 class no_assign {
00313
00314 void operator=( const no_assign& );
00315 public:
00316 #if __GNUC__
00318 no_assign() {}
00319 #endif
00320 };
00321
00323 class no_copy: no_assign {
00325 no_copy( const no_copy& );
00326 public:
00328 no_copy() {}
00329 };
00330
00332 template<typename T>
00333 struct allocator_type {
00334 typedef T value_type;
00335 };
00336
00337 #if _MSC_VER
00339 template<typename T>
00340 struct allocator_type<const T> {
00341 typedef T value_type;
00342 };
00343 #endif
00344
00345
00348 struct version_tag_v3 {};
00349
00350 typedef version_tag_v3 version_tag;
00351
00352 }
00354
00355 }
00356
00357 #endif
00358 #endif