tbb_stddef.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# tbb_stddef.h

    00001 /*
    00002     Copyright 2005-2010 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_stddef_H
    00022 #define __TBB_tbb_stddef_H
    00023
    00024 // Marketing-driven product version
    00025 #define TBB_VERSION_MAJOR 3
    00026 #define TBB_VERSION_MINOR 0
    00027
    00028 // Engineering-focused interface version
    00029 #define TBB_INTERFACE_VERSION 5004
    00030 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000
    00031
    00032 // The oldest major interface version still supported
    00033 // To be used in SONAME, manifests, etc.
    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 // We do not need defines below for resource processing on windows
    00040 #if !defined RC_INVOKED
    00041
    00042 // Define groups for Doxygen documentation
    00052 // Simple text that is displayed on the main page of Doxygen documentation.
    00094 // Define preprocessor symbols used to determine architecture
    00095 #if _WIN32||_WIN64
    00096 #   if defined(_M_AMD64)
    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 /* Assume generic Unix */
    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 #if _MSC_VER
    00119 // define the parts of stdint.h that are needed, but put them inside tbb::internal
    00120 namespace tbb {
    00121 namespace internal {
    00122     typedef __int8 int8_t;
    00123     typedef __int16 int16_t;
    00124     typedef __int32 int32_t;
    00125     typedef __int64 int64_t;
    00126     typedef unsigned __int8 uint8_t;
    00127     typedef unsigned __int16 uint16_t;
    00128     typedef unsigned __int32 uint32_t;
    00129     typedef unsigned __int64 uint64_t;
    00130 } // namespace internal
    00131 } // namespace tbb
    00132 #else
    00133 #include <stdint.h>
    00134 #endif /* _MSC_VER */
    00135
    00136 #if _MSC_VER >=1400
    00137 #define __TBB_EXPORTED_FUNC   __cdecl
    00138 #define __TBB_EXPORTED_METHOD __thiscall
    00139 #else
    00140 #define __TBB_EXPORTED_FUNC
    00141 #define __TBB_EXPORTED_METHOD
    00142 #endif
    00143
    00144 #include <cstddef>      /* Need size_t and ptrdiff_t */
    00145
    00146 #if _MSC_VER
    00147 #define __TBB_tbb_windef_H
    00148 #include "_tbb_windef.h"
    00149 #undef __TBB_tbb_windef_H
    00150 #endif
    00151
    00152 #include "tbb_config.h"
    00153
    00155 namespace tbb {
    00156
    00157 using std::size_t; using std::ptrdiff_t;
    00158
    00160     typedef void(*assertion_handler_type)( const char* filename, int line, const char* expression, const char * comment );
    00161
    00162 #if TBB_USE_ASSERT
    00163
    00165
    00168 #define __TBB_ASSERT(predicate,message) ((predicate)?((void)0):tbb::assertion_failure(__FILE__,__LINE__,#predicate,message))
    00169 #define __TBB_ASSERT_EX __TBB_ASSERT
    00170
    00172     assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler( assertion_handler_type new_handler );
    00173
    00175
    00178     void __TBB_EXPORTED_FUNC assertion_failure( const char* filename, int line, const char* expression, const char* comment );
    00179
    00180 #else
    00181
    00183 #define __TBB_ASSERT(predicate,comment) ((void)0)
    00185 #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))
    00186
    00187 #endif /* TBB_USE_ASSERT */
    00188
    00190
    00194 extern "C" int __TBB_EXPORTED_FUNC TBB_runtime_interface_version();
    00195
    00197
    00201 class split {
    00202 };
    00203
    00208 namespace internal {
    00209
    00211
    00214 const size_t NFS_MaxLineSize = 128;
    00215
    00216 template<class T, int S>
    00217 struct padded_base : T {
    00218     char pad[NFS_MaxLineSize - sizeof(T) % NFS_MaxLineSize];
    00219 };
    00220 template<class T> struct padded_base<T, 0> : T {};
    00221
    00223 template<class T>
    00224 struct padded : padded_base<T, sizeof(T)> {};
    00225
    00227
    00229 #define __TBB_offsetof(class_name, member_name) \
    00230     ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000)
    00231
    00233 #define __TBB_get_object_ref(class_name, member_name, member_addr) \
    00234     (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name)))
    00235
    00237 void __TBB_EXPORTED_FUNC handle_perror( int error_code, const char* aux_info );
    00238
    00239 #if TBB_USE_EXCEPTIONS
    00240     #define __TBB_TRY try
    00241     #define __TBB_CATCH(e) catch(e)
    00242     #define __TBB_THROW(e) throw e
    00243     #define __TBB_RETHROW() throw
    00244 #else /* !TBB_USE_EXCEPTIONS */
    00245     inline bool __TBB_false() { return false; }
    00246     #define __TBB_TRY
    00247     #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() )
    00248     #define __TBB_THROW(e) ((void)0)
    00249     #define __TBB_RETHROW() ((void)0)
    00250 #endif /* !TBB_USE_EXCEPTIONS */
    00251
    00253 void __TBB_EXPORTED_FUNC runtime_warning( const char* format, ... );
    00254
    00255 #if TBB_USE_ASSERT
    00256 static void* const poisoned_ptr = reinterpret_cast<void*>(-1);
    00257
    00259 template<typename T>
    00260 inline void poison_pointer( T*& p ) { p = reinterpret_cast<T*>(poisoned_ptr); }
    00261
    00263 template<typename T>
    00264 inline bool is_poisoned( T* p ) { return p == reinterpret_cast<T*>(poisoned_ptr); }
    00265 #else
    00266 template<typename T>
    00267 inline void poison_pointer( T* ) {/*do nothing*/}
    00268 #endif /* !TBB_USE_ASSERT */
    00269
    00271
    00273 template<typename T, typename U>
    00274 inline T punned_cast( U* ptr ) {
    00275     uintptr_t x = reinterpret_cast<uintptr_t>(ptr);
    00276     return reinterpret_cast<T>(x);
    00277 }
    00278
    00280 class no_assign {
    00281     // Deny assignment
    00282     void operator=( const no_assign& );
    00283 public:
    00284 #if __GNUC__
    00286     no_assign() {}
    00287 #endif /* __GNUC__ */
    00288 };
    00289
    00291 class no_copy: no_assign {
    00293     no_copy( const no_copy& );
    00294 public:
    00296     no_copy() {}
    00297 };
    00298
    00300 template<typename T>
    00301 struct allocator_type {
    00302     typedef T value_type;
    00303 };
    00304
    00305 #if _MSC_VER
    00307 template<typename T>
    00308 struct allocator_type<const T> {
    00309     typedef T value_type;
    00310 };
    00311 #endif
    00312
    00313 // Struct to be used as a version tag for inline functions.
    00316 struct version_tag_v3 {};
    00317
    00318 typedef version_tag_v3 version_tag;
    00319
    00320 } // internal
    00322
    00323 } // tbb
    00324
    00325 #endif /* RC_INVOKED */
    00326 #endif /* __TBB_tbb_stddef_H */

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