Shadowrun: Awakened 29 September 2011 - Build 871
tbb_stddef.h
Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2010 Intel Corporation.  All Rights Reserved.
00003 
00004     This file is part of Threading Building Blocks.
00005 
00006     Threading Building Blocks is free software; you can redistribute it
00007     and/or modify it under the terms of the GNU General Public License
00008     version 2 as published by the Free Software Foundation.
00009 
00010     Threading Building Blocks is distributed in the hope that it will be
00011     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00012     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with Threading Building Blocks; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019     As a special exception, you may use this file as part of a free software
00020     library without restriction.  Specifically, if other files instantiate
00021     templates or use macros or inline functions from this file, or you compile
00022     this file and link it with other files to produce an executable, this
00023     file does not by itself cause the resulting executable to be covered by
00024     the GNU General Public License.  This exception does not however
00025     invalidate any other reasons why the executable file might be covered by
00026     the GNU General Public License.
00027 */
00028 
00029 #ifndef __TBB_tbb_stddef_H
00030 #define __TBB_tbb_stddef_H
00031 
00032 // Marketing-driven product version
00033 #define TBB_VERSION_MAJOR 3
00034 #define TBB_VERSION_MINOR 0
00035 
00036 // Engineering-focused interface version
00037 #define TBB_INTERFACE_VERSION 5000
00038 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000
00039 
00040 // The oldest major interface version still supported
00041 // To be used in SONAME, manifests, etc.
00042 #define TBB_COMPATIBLE_INTERFACE_VERSION 2
00043 
00044 #define __TBB_STRING_AUX(x) #x
00045 #define __TBB_STRING(x) __TBB_STRING_AUX(x)
00046 
00047 // We do not need defines below for resource processing on windows
00048 #if !defined RC_INVOKED
00049 
00050 // Define groups for Doxygen documentation
00060 // Simple text that is displayed on the main page of Doxygen documentation.
00102 // Define preprocessor symbols used to determine architecture
00103 #if _WIN32||_WIN64
00104 #   if defined(_M_AMD64)
00105 #       define __TBB_x86_64 1
00106 #   elif defined(_M_IA64)
00107 #       define __TBB_ipf 1
00108 #   elif defined(_M_IX86)||defined(__i386__) // the latter for MinGW support
00109 #       define __TBB_x86_32 1
00110 #   endif
00111 #else /* Assume generic Unix */
00112 #   if !__linux__ && !__APPLE__
00113 #       define __TBB_generic_os 1
00114 #   endif
00115 #   if __x86_64__
00116 #       define __TBB_x86_64 1
00117 #   elif __ia64__
00118 #       define __TBB_ipf 1
00119 #   elif __i386__||__i386  // __i386 is for Sun OS
00120 #       define __TBB_x86_32 1
00121 #   else
00122 #       define __TBB_generic_arch 1
00123 #   endif
00124 #endif
00125 
00126 #if _MSC_VER
00127 // define the parts of stdint.h that are needed, but put them inside tbb::internal
00128 namespace tbb {
00129 namespace internal {
00130     typedef __int8 int8_t;
00131     typedef __int16 int16_t;
00132     typedef __int32 int32_t;
00133     typedef __int64 int64_t;
00134     typedef unsigned __int8 uint8_t;
00135     typedef unsigned __int16 uint16_t;
00136     typedef unsigned __int32 uint32_t;
00137     typedef unsigned __int64 uint64_t;
00138 } // namespace internal
00139 } // namespace tbb
00140 #else
00141 #include <stdint.h>
00142 #endif /* _MSC_VER */
00143 
00144 #if _MSC_VER >=1400
00145 #define __TBB_EXPORTED_FUNC   __cdecl
00146 #define __TBB_EXPORTED_METHOD __thiscall
00147 #else
00148 #define __TBB_EXPORTED_FUNC
00149 #define __TBB_EXPORTED_METHOD
00150 #endif
00151 
00152 #include <cstddef>      /* Need size_t and ptrdiff_t (the latter on Windows only) from here. */
00153 
00154 #if _MSC_VER
00155 #define __TBB_tbb_windef_H
00156 #include "_tbb_windef.h"
00157 #undef __TBB_tbb_windef_H
00158 #endif
00159 
00160 #include "tbb_config.h"
00161 
00163 namespace tbb {
00165     typedef void(*assertion_handler_type)( const char* filename, int line, const char* expression, const char * comment );
00166 
00167 #if TBB_USE_ASSERT
00168 
00170 
00173 #define __TBB_ASSERT(predicate,message) ((predicate)?((void)0):tbb::assertion_failure(__FILE__,__LINE__,#predicate,message))
00174 #define __TBB_ASSERT_EX __TBB_ASSERT
00175 
00177     assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler( assertion_handler_type new_handler );
00178 
00180 
00183     void __TBB_EXPORTED_FUNC assertion_failure( const char* filename, int line, const char* expression, const char* comment );
00184 
00185 #else
00186 
00188 #define __TBB_ASSERT(predicate,comment) ((void)0)
00189 
00190 #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))
00191 
00192 #endif /* TBB_USE_ASSERT */
00193 
00195 
00199 extern "C" int __TBB_EXPORTED_FUNC TBB_runtime_interface_version();
00200 
00202 
00206 class split {
00207 };
00208 
00213 namespace internal {
00214 
00215 using std::size_t;
00216 
00218 
00221 const size_t NFS_MaxLineSize = 128;
00222 
00223 template<class T, int S>
00224 struct padded_base : T {
00225     char pad[NFS_MaxLineSize - sizeof(T) % NFS_MaxLineSize];
00226 };
00227 template<class T> struct padded_base<T, 0> : T {};
00228 
00230 template<class T>
00231 struct padded : padded_base<T, sizeof(T)> {};
00232 
00234 
00236 #define __TBB_offsetof(class_name, member_name) \
00237     ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000)
00238 
00240 #define __TBB_get_object_ref(class_name, member_name, member_addr) \
00241     (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name)))
00242 
00244 void __TBB_EXPORTED_FUNC handle_perror( int error_code, const char* aux_info );
00245 
00246 #if TBB_USE_EXCEPTIONS
00247     #define __TBB_TRY try
00248     #define __TBB_CATCH(e) catch(e)
00249     #define __TBB_THROW(e) throw e
00250     #define __TBB_RETHROW() throw
00251 #else /* !TBB_USE_EXCEPTIONS */
00252     inline bool __TBB_false() { return false; }
00253     #define __TBB_TRY
00254     #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() )
00255     #define __TBB_THROW(e) ((void)0)
00256     #define __TBB_RETHROW() ((void)0)
00257 #endif /* !TBB_USE_EXCEPTIONS */
00258 
00260 void __TBB_EXPORTED_FUNC runtime_warning( const char* format, ... );
00261 
00262 #if TBB_USE_ASSERT
00263 
00264 template<typename T>
00265 inline void poison_pointer( T* & p ) {
00266     p = reinterpret_cast<T*>(-1);
00267 }
00268 #else
00269 template<typename T>
00270 inline void poison_pointer( T* ) {/*do nothing*/}
00271 #endif /* TBB_USE_ASSERT */
00272 
00274 class no_assign {
00275     // Deny assignment
00276     void operator=( const no_assign& );
00277 public:
00278 #if __GNUC__
00279 
00280     no_assign() {}
00281 #endif /* __GNUC__ */
00282 };
00283 
00285 class no_copy: no_assign {
00287     no_copy( const no_copy& );
00288 public:
00290     no_copy() {}
00291 };
00292 
00294 template<typename T>
00295 struct allocator_type {
00296     typedef T value_type;
00297 };
00298 
00299 #if _MSC_VER
00300 
00301 template<typename T>
00302 struct allocator_type<const T> {
00303     typedef T value_type;
00304 };
00305 #endif
00306 
00307 // Struct to be used as a version tag for inline functions.
00310 struct version_tag_v3 {};
00311 
00312 typedef version_tag_v3 version_tag;
00313 
00314 } // internal
00316 
00317 } // tbb
00318 
00319 #endif /* RC_INVOKED */
00320 #endif /* __TBB_tbb_stddef_H */

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net