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 3
00026 #define TBB_VERSION_MINOR 0
00027
00028
00029 #define TBB_INTERFACE_VERSION 5006
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
00122
00123 namespace tbb {
00124 namespace internal {
00125 typedef __int8 int8_t;
00126 typedef __int16 int16_t;
00127 typedef __int32 int32_t;
00128 typedef __int64 int64_t;
00129 typedef unsigned __int8 uint8_t;
00130 typedef unsigned __int16 uint16_t;
00131 typedef unsigned __int32 uint32_t;
00132 typedef unsigned __int64 uint64_t;
00133 }
00134 }
00135 #else
00136 #include <stdint.h>
00137 #endif
00138
00139 #if _MSC_VER >=1400
00140 #define __TBB_EXPORTED_FUNC __cdecl
00141 #define __TBB_EXPORTED_METHOD __thiscall
00142 #else
00143 #define __TBB_EXPORTED_FUNC
00144 #define __TBB_EXPORTED_METHOD
00145 #endif
00146
00147 #include <cstddef>
00148
00149 #if _MSC_VER
00150 #define __TBB_tbb_windef_H
00151 #include "_tbb_windef.h"
00152 #undef __TBB_tbb_windef_H
00153 #endif
00154
00156 namespace tbb {
00157
00158 using std::size_t; using std::ptrdiff_t;
00159
00161 typedef void(*assertion_handler_type)( const char* filename, int line, const char* expression, const char * comment );
00162
00163 #if TBB_USE_ASSERT
00164
00166
00169 #define __TBB_ASSERT(predicate,message) ((predicate)?((void)0):tbb::assertion_failure(__FILE__,__LINE__,#predicate,message))
00170 #define __TBB_ASSERT_EX __TBB_ASSERT
00171
00173 assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler( assertion_handler_type new_handler );
00174
00176
00179 void __TBB_EXPORTED_FUNC assertion_failure( const char* filename, int line, const char* expression, const char* comment );
00180
00181 #else
00182
00184 #define __TBB_ASSERT(predicate,comment) ((void)0)
00186 #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))
00187
00188 #endif
00189
00191
00195 extern "C" int __TBB_EXPORTED_FUNC TBB_runtime_interface_version();
00196
00198
00202 class split {
00203 };
00204
00209 namespace internal {
00210
00212
00215 const size_t NFS_MaxLineSize = 128;
00216
00217 template<class T, int S>
00218 struct padded_base : T {
00219 char pad[NFS_MaxLineSize - sizeof(T) % NFS_MaxLineSize];
00220 };
00221 template<class T> struct padded_base<T, 0> : T {};
00222
00224 template<class T>
00225 struct padded : padded_base<T, sizeof(T)> {};
00226
00228
00230 #define __TBB_offsetof(class_name, member_name) \
00231 ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000)
00232
00234 #define __TBB_get_object_ref(class_name, member_name, member_addr) \
00235 (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name)))
00236
00238 void __TBB_EXPORTED_FUNC handle_perror( int error_code, const char* aux_info );
00239
00240 #if TBB_USE_EXCEPTIONS
00241 #define __TBB_TRY try
00242 #define __TBB_CATCH(e) catch(e)
00243 #define __TBB_THROW(e) throw e
00244 #define __TBB_RETHROW() throw
00245 #else
00246 inline bool __TBB_false() { return false; }
00247 #define __TBB_TRY
00248 #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() )
00249 #define __TBB_THROW(e) ((void)0)
00250 #define __TBB_RETHROW() ((void)0)
00251 #endif
00252
00254 void __TBB_EXPORTED_FUNC runtime_warning( const char* format, ... );
00255
00256 #if TBB_USE_ASSERT
00257 static void* const poisoned_ptr = reinterpret_cast<void*>(-1);
00258
00260 template<typename T>
00261 inline void poison_pointer( T*& p ) { p = reinterpret_cast<T*>(poisoned_ptr); }
00262
00264 template<typename T>
00265 inline bool is_poisoned( T* p ) { return p == reinterpret_cast<T*>(poisoned_ptr); }
00266 #else
00267 template<typename T>
00268 inline void poison_pointer( T* ) {}
00269 #endif
00270
00272
00274 template<typename T, typename U>
00275 inline T punned_cast( U* ptr ) {
00276 uintptr_t x = reinterpret_cast<uintptr_t>(ptr);
00277 return reinterpret_cast<T>(x);
00278 }
00279
00281 class no_assign {
00282
00283 void operator=( const no_assign& );
00284 public:
00285 #if __GNUC__
00287 no_assign() {}
00288 #endif
00289 };
00290
00292 class no_copy: no_assign {
00294 no_copy( const no_copy& );
00295 public:
00297 no_copy() {}
00298 };
00299
00301 template<typename T>
00302 struct allocator_type {
00303 typedef T value_type;
00304 };
00305
00306 #if _MSC_VER
00308 template<typename T>
00309 struct allocator_type<const T> {
00310 typedef T value_type;
00311 };
00312 #endif
00313
00314
00317 struct version_tag_v3 {};
00318
00319 typedef version_tag_v3 version_tag;
00320
00321 }
00323
00324 }
00325
00326 #endif
00327 #endif