Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenPrefix.h
Go to the documentation of this file.
00001 /*********************************************************************************** 00002 Prefix.h 00003 00004 * Copyright (c) 1997 00005 * Mark of the Unicorn, Inc. 00006 * 00007 * Permission to use, copy, modify, distribute and sell this software 00008 * and its documentation for any purpose is hereby granted without fee, 00009 * provided that the above copyright notice appear in all copies and 00010 * that both that copyright notice and this permission notice appear 00011 * in supporting documentation. Mark of the Unicorn makes no 00012 * representations about the suitability of this software for any 00013 * purpose. It is provided "as is" without express or implied warranty. 00014 00015 SUMMARY: Configuration #defines for STL EH test suite 00016 00017 ***********************************************************************************/ 00018 00019 #ifndef INCLUDED_MOTU_Prefix 00020 #define INCLUDED_MOTU_Prefix 1 00021 00022 // Gives much more thorough checking, but may slow the tests 00023 // considerably if your malloc is slow. 00024 #define TESTCLASS_DEEP_DATA 1 00025 00026 # ifndef NO_FAST_ALLOCATOR 00027 // # define NO_FAST_ALLOCATOR 00028 # endif 00029 00030 // Define this to use the SGI STL. Undefine it to test a different installation 00031 #ifndef EH_NO_SGI_STL 00032 # define EH_USE_SGI_STL 1 00033 #endif 00034 00035 #if EH_USE_SGI_STL 00036 00037 #define EH_ASSERT _STLP_ASSERT 00038 00039 //========================================================================= 00040 // SGI STL-specific #defines 00041 // These control the behavior of the test suite when used with the SGI 00042 // STL. They have no effect when testing other STL implementations. 00043 //========================================================================= 00044 00045 #ifndef _STLP_USE_NEWALLOC 00046 # define _STLP_USE_NEWALLOC 00047 #endif 00048 00049 #if 0 // !defined (_STLP_NO_CUSTOM_IO) && ! defined (__BORLANDC__) 00050 # define _STLP_NO_CUSTOM_IO 00051 #endif 00052 00053 // Just include something to get whatever configuration header we're using. 00054 #include <utility> 00055 00056 #ifndef _STLP_CALL 00057 # define _STLP_CALL 00058 #endif 00059 00060 #if defined(_STLP_USE_NAMESPACES) 00061 # define EH_USE_NAMESPACES _STLP_USE_NAMESPACES 00062 #endif 00063 00064 #define EH_BEGIN_NAMESPACE _STLP_BEGIN_NAMESPACE 00065 #define EH_END_NAMESPACE _STLP_END_NAMESPACE 00066 00067 #define EH_NEW_HEADERS 1 00068 00069 //#if defined (_STLP_USE_NEW_IOSTREAMS) 00070 #define EH_NEW_IOSTREAMS 1 00071 //#endif 00072 00073 #if !defined (_STLP_USE_EXCEPTIONS) 00074 # define EH_NO_EXCEPTIONS 00075 #endif 00076 00077 #if defined (_STLP_TEMPLATE_PARAM_SUBTYPE_BUG) 00078 # define EH_TEMPLATE_PARAM_SUBTYPE_BUG _STLP_TEMPLATE_PARAM_SUBTYPE_BUG 00079 #endif 00080 00081 #if defined(_STLP_MULTI_CONST_TEMPLATE_ARG_BUG) 00082 # define EH_MULTI_CONST_TEMPLATE_ARG_BUG _STLP_MULTI_CONST_TEMPLATE_ARG_BUG 00083 #endif 00084 00085 #if defined (STLPORT) 00086 # define EH_STD STLPORT 00087 #elif defined(__STD) 00088 # define EH_STD __STD 00089 #endif 00090 00091 // we want to be portable here, so std:: won't work. 00092 #if defined(STLPORT_CSTD) 00093 # define EH_CSTD STLPORT_CSTD 00094 #else 00095 # define EH_CSTD std 00096 #endif 00097 00098 #define EH_DISTANCE(a, b, result) EH_STD::distance(a, b, result) 00099 00100 #define EH_HASHED_CONTAINERS_IMPLEMENTED 1 00101 #define EH_HASH_CONTAINERS_SUPPORT_RESIZE 1 00102 #define EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION 1 00103 #define EH_SLIST_IMPLEMENTED 1 00104 #define EH_SELECT1ST_HINT __select1st_hint 00105 // fbp : DEC cxx is unable to compile it for some reason 00106 #if !(defined (__DECCXX) || defined (__amigaos__) || \ 00107 (defined (__GNUC__) && (__GNUC__ <= 2) && (__GNUC_MINOR__ < 8))) 00108 # define EH_ROPE_IMPLEMENTED 1 00109 #endif 00110 #define EH_STRING_IMPLEMENTED 1 00111 // # define EH_BITSET_IMPLEMENTED 1 00112 //# define EH_VALARRAY_IMPLEMENTED 1 - we have no tests yet for valarray 00113 00114 #define stl_destroy EH_STD::destroy 00115 #include <memory> 00116 00117 template <class _Tp> 00118 class /*_STLP_CLASS_DECLSPEC*/ EH_allocator; 00119 00120 template <class _Tp> 00121 class /*_STLP_CLASS_DECLSPEC*/ EH_allocator { 00122 public: 00123 00124 typedef _Tp value_type; 00125 typedef value_type * pointer; 00126 typedef const _Tp* const_pointer; 00127 typedef _Tp& reference; 00128 typedef const _Tp& const_reference; 00129 typedef EH_CSTD::size_t size_type; 00130 typedef EH_CSTD::ptrdiff_t difference_type; 00131 # if defined (_STLP_MEMBER_TEMPLATE_CLASSES) 00132 template <class _Tp1> struct rebind { 00133 typedef EH_allocator<_Tp1> other; 00134 }; 00135 # endif 00136 EH_allocator() _STLP_NOTHROW {} 00137 # if defined (_STLP_MEMBER_TEMPLATES) 00138 template <class _Tp1> EH_allocator(const EH_allocator<_Tp1>&) _STLP_NOTHROW {} 00139 # endif 00140 EH_allocator(const EH_allocator<_Tp>&) _STLP_NOTHROW {} 00141 ~EH_allocator() _STLP_NOTHROW {} 00142 pointer address(reference __x) { return &__x; } 00143 const_pointer address(const_reference __x) const { return &__x; } 00144 // __n is permitted to be 0. The C++ standard says nothing about what the return value is when __n == 0. 00145 _Tp* allocate(size_type __n, const void* = 0) const { 00146 return __n != 0 ? __REINTERPRET_CAST(value_type*,EH_STD::__new_alloc::allocate(__n * sizeof(value_type))) : 0; 00147 } 00148 // __p is permitted to be a null pointer, only if n==0. 00149 void deallocate(pointer __p, size_type __n) const { 00150 _STLP_ASSERT( (__p == 0) == (__n == 0) ) 00151 if (__p != 0) EH_STD::__new_alloc::deallocate((void*)__p, __n * sizeof(value_type)); 00152 } 00153 // backwards compatibility 00154 void deallocate(pointer __p) const { if (__p != 0) EH_STD::__new_alloc::deallocate((void*)__p, sizeof(value_type)); } 00155 size_type max_size() const _STLP_NOTHROW { return size_t(-1) / sizeof(value_type); } 00156 void construct(pointer __p, const _Tp& __val) const { stlport::construct(__p, __val); } 00157 void destroy(pointer __p) const { stlport::destroy(__p); } 00158 }; 00159 00160 template <class _T1> inline bool _STLP_CALL operator==(const EH_allocator<_T1>&, const EH_allocator<_T1>&) { return true; } 00161 template <class _T1> inline bool _STLP_CALL operator!=(const EH_allocator<_T1>&, const EH_allocator<_T1>&) { return false; } 00162 00163 _STLP_BEGIN_NAMESPACE 00164 // If custom allocators are being used without member template classes support : 00165 // user (on purpose) is forced to define rebind/get operations !!! 00166 template <class _Tp1, class _Tp2> 00167 inline EH_allocator<_Tp2>& _STLP_CALL 00168 __stl_alloc_rebind(EH_allocator<_Tp1>& __a, const _Tp2*) { return (EH_allocator<_Tp2>&)(__a); } 00169 template <class _Tp1, class _Tp2> 00170 inline EH_allocator<_Tp2> _STLP_CALL 00171 __stl_alloc_create(const EH_allocator<_Tp1>&, const _Tp2*) { return EH_allocator<_Tp2>(); } 00172 _STLP_END_NAMESPACE 00173 00174 # define eh_allocator(T) ::EH_allocator<T> 00175 00176 # define EH_BIT_VECTOR_IMPLEMENTED 00177 00178 # if defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined(_STLP_NO_BOOL) 00179 # define EH_BIT_VECTOR EH_STD::vector<bool, eh_allocator(bool) > 00180 # else 00181 # ifdef _STLP_NO_BOOL 00182 # undef EH_BIT_VECTOR_IMPLEMENTED 00183 # else 00184 # define EH_BIT_VECTOR EH_STD::vector<bool, eh_allocator(bool) > 00185 # endif 00186 # endif 00187 00188 #else // !USE_SGI_STL 00189 //========================================================================= 00190 // Configuration for testing other non-SGI STL implementations 00191 //========================================================================= 00192 00193 // Metrowerks configuration 00194 # ifdef __MWERKS__ 00195 00196 # define EH_ASSERT assert 00197 // Get MSL configuration header 00198 # include <ansi_parms.h> 00199 00200 # if __MSL__ >= 24 00201 00202 # define EH_NEW_HEADERS 1 00203 # if defined (_MSL_USING_NAMESPACE) 00204 # define EH_USE_NAMESPACES 1 00205 # endif 00206 # define EH_BIT_VECTOR vector<bool> 00207 # define EH_DISTANCE( a, b, result ) do { result = distance( a, b ); } while (0) 00208 00209 # else 00210 00211 # error No configuration for earlier versions of MSL 00212 00213 # endif // __MSL__ >= 24 00214 00215 // Bugs fixed in CWPro3 00216 # if __MWERKS__ < 0x2100 00217 # define EH_TEMPLATE_PARAM_SUBTYPE_BUG 1 00218 # endif 00219 00220 // Bugs in CWPro3 00221 # if __MWERKS__ <= 0x2110 00222 # define EH_MULTI_CONST_TEMPLATE_ARG_BUG 1 00223 # else 00224 # pragma warning not sure the above bug is fixed yet 00225 # endif 00226 00227 # define EH_SLIST_IMPLEMENTED 1 00228 //# define EH_HASHED_CONTAINERS_IMPLEMENTED 1 00229 00230 # define EH_NEW_IOSTREAMS 1 00231 # define EH_USE_NOTHROW 1 00232 # endif // Metrowerks configuration 00233 00234 #if defined (__SUNPRO_CC) 00235 # define stl_destroy __RWSTD::__destroy 00236 # define EH_DISTANCE( a, b, result ) distance( a, b, result ) 00237 # define EH_BIT_VECTOR EH_STD::vector<bool> 00238 # define EH_NEW_HEADERS 1 00239 # define EH_USE_NAMESPACES 1 00240 # define EH_NEW_IOSTREAMS 1 00241 # define EH_ASSERT assert 00242 # define EH_STRING_IMPLEMENTED 1 00243 # elif defined (__KCC) 00244 # define stl_destroy EH_STD::destroy 00245 # define EH_DISTANCE( a, b, result ) do { result = distance( a, b ); } while (0) 00246 # define EH_BIT_VECTOR EH_STD::vector<bool> 00247 # define EH_NEW_HEADERS 1 00248 # define EH_USE_NAMESPACES 1 00249 # define EH_NEW_IOSTREAMS 1 00250 # define EH_ASSERT assert 00251 # define EH_CSTD 00252 # define EH_STRING_IMPLEMENTED 1 00253 # define EH_MULTI_CONST_TEMPLATE_ARG_BUG 1 00254 # define EH_SELECT1ST_HINT select1st 00255 # else 00256 # define stl_destroy destroy 00257 #endif 00258 00259 // 00260 // Compiler-independent configuration 00261 // 00262 # ifdef EH_USE_NAMESPACES 00263 # ifdef STLPORT 00264 # define EH_STD STLPORT 00265 # else 00266 # define EH_STD std 00267 # endif 00268 # ifdef STLPORT_CSTD 00269 # define EH_STD STLPORT_CSTD 00270 # else 00271 # define EH_STD std 00272 # endif 00273 # define EH_BEGIN_NAMESPACE namespace EH_STD { 00274 # define EH_END_NAMESPACE } 00275 # else 00276 # define EH_BEGIN_NAMESPACE 00277 # define EH_END_NAMESPACE 00278 # define EH_STD 00279 # endif 00280 00281 # ifndef EH_CSTD 00282 # define EH_CSTD EH_STD 00283 # endif 00284 00285 #endif // !USE_SGI_STL 00286 00287 00288 // 00289 // Library-independent configuration. 00290 // 00291 #if defined( EH_MULTI_CONST_TEMPLATE_ARG_BUG) && !defined( EH_SELECT1ST_HINT ) 00292 template <class Pair, class U> 00293 // JDJ (CW Pro1 doesn't like const when first_type is also const) 00294 struct eh_select1st_hint : public unary_function<Pair, U> { 00295 const U& operator () (const Pair& x) const { return x.first; } 00296 }; 00297 # define EH_SELECT1ST_HINT eh_select1st_hint 00298 #endif 00299 00300 00301 #if EH_USE_NAMESPACES 00302 # define EH_USE_STD using namespace EH_STD; 00303 #else 00304 # define EH_USE_STD 00305 #endif 00306 00307 #if defined (EH_USE_NAMESPACES) && !defined(_STLP_VENDOR_GLOBAL_CSTD) 00308 # define USING_CSTD_NAME(name) using EH_CSTD :: name; 00309 #else 00310 # define USING_CSTD_NAME(name) 00311 #endif 00312 00313 #endif // INCLUDED_MOTU_Prefix Generated on Sat May 26 2012 04:34:05 for ReactOS by
1.7.6.1
|