stlport.hpp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. // (C) Copyright John Maddock 2001 - 2002.
  2. // (C) Copyright Darin Adler 2001.
  3. // (C) Copyright Jens Maurer 2001.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org for most recent version.
  8. // STLPort standard library config:
  9. #if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
  10. # include <cstddef>
  11. # if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
  12. # error "This is not STLPort!"
  13. # endif
  14. #endif
  15. //
  16. // __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  17. // for versions prior to 4.1(beta)
  18. //
  19. #if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400)
  20. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  21. #endif
  22. //
  23. // If STLport thinks that there is no partial specialisation, then there is no
  24. // std::iterator traits:
  25. //
  26. #if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION))
  27. # define BOOST_NO_STD_ITERATOR_TRAITS
  28. #endif
  29. //
  30. // No new style iostreams on GCC without STLport's iostreams enabled:
  31. //
  32. #if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS))
  33. # define BOOST_NO_STRINGSTREAM
  34. #endif
  35. //
  36. // No new iostreams implies no std::locale, and no std::stringstream:
  37. //
  38. #if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS)
  39. # define BOOST_NO_STD_LOCALE
  40. # define BOOST_NO_STRINGSTREAM
  41. #endif
  42. //
  43. // If the streams are not native, and we have a "using ::x" compiler bug
  44. // then the io stream facets are not available in namespace std::
  45. //
  46. #ifdef _STLPORT_VERSION
  47. # if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
  48. # define BOOST_NO_STD_LOCALE
  49. # endif
  50. #else
  51. # if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
  52. # define BOOST_NO_STD_LOCALE
  53. # endif
  54. #endif
  55. #if defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x500) || (_STLPORT_VERSION >= 0x520))
  56. # define BOOST_NO_STD_UNORDERED
  57. #endif
  58. #if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
  59. # define BOOST_HAS_TR1_UNORDERED_SET
  60. # define BOOST_HAS_TR1_UNORDERED_MAP
  61. #endif
  62. //
  63. // Without member template support enabled, their are no template
  64. // iterate constructors, and no std::allocator:
  65. //
  66. #if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES))
  67. # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
  68. # define BOOST_NO_STD_ALLOCATOR
  69. #endif
  70. //
  71. // however we always have at least a partial allocator:
  72. //
  73. #define BOOST_HAS_PARTIAL_STD_ALLOCATOR
  74. #if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
  75. # define BOOST_NO_STD_ALLOCATOR
  76. #endif
  77. #if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
  78. # define BOOST_NO_STD_ALLOCATOR
  79. #endif
  80. //
  81. // If STLport thinks there is no wchar_t at all, then we have to disable
  82. // the support for the relevant specilazations of std:: templates.
  83. //
  84. #if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT)
  85. # ifndef BOOST_NO_STD_WSTRING
  86. # define BOOST_NO_STD_WSTRING
  87. # endif
  88. # ifndef BOOST_NO_STD_WSTREAMBUF
  89. # define BOOST_NO_STD_WSTREAMBUF
  90. # endif
  91. #endif
  92. //
  93. // We always have SGI style hash_set, hash_map, and slist:
  94. //
  95. #ifndef _STLP_NO_EXTENSIONS
  96. #define BOOST_HAS_HASH
  97. #define BOOST_HAS_SLIST
  98. #endif
  99. //
  100. // STLport does a good job of importing names into namespace std::,
  101. // but doesn't always get them all, define BOOST_NO_STDC_NAMESPACE, since our
  102. // workaround does not conflict with STLports:
  103. //
  104. //
  105. // Harold Howe says:
  106. // Borland switched to STLport in BCB6. Defining BOOST_NO_STDC_NAMESPACE with
  107. // BCB6 does cause problems. If we detect C++ Builder, then don't define
  108. // BOOST_NO_STDC_NAMESPACE
  109. //
  110. #if !defined(__BORLANDC__) && !defined(__DMC__)
  111. //
  112. // If STLport is using it's own namespace, and the real names are in
  113. // the global namespace, then we duplicate STLport's using declarations
  114. // (by defining BOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't
  115. // necessarily import all the names we need into namespace std::
  116. //
  117. # if (defined(__STL_IMPORT_VENDOR_CSTD) \
  118. || defined(__STL_USE_OWN_NAMESPACE) \
  119. || defined(_STLP_IMPORT_VENDOR_CSTD) \
  120. || defined(_STLP_USE_OWN_NAMESPACE)) \
  121. && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD))
  122. # define BOOST_NO_STDC_NAMESPACE
  123. # define BOOST_NO_EXCEPTION_STD_NAMESPACE
  124. # endif
  125. #elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
  126. // STLport doesn't import std::abs correctly:
  127. #include <stdlib.h>
  128. namespace std { using ::abs; }
  129. // and strcmp/strcpy don't get imported either ('cos they are macros)
  130. #include <string.h>
  131. #ifdef strcpy
  132. # undef strcpy
  133. #endif
  134. #ifdef strcmp
  135. # undef strcmp
  136. #endif
  137. #ifdef _STLP_VENDOR_CSTD
  138. namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; }
  139. #endif
  140. #endif
  141. //
  142. // std::use_facet may be non-standard, uses a class instead:
  143. //
  144. #if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
  145. # define BOOST_NO_STD_USE_FACET
  146. # define BOOST_HAS_STLP_USE_FACET
  147. #endif
  148. //
  149. // If STLport thinks there are no wide functions, <cwchar> etc. is not working; but
  150. // only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import
  151. // into std:: ourselves).
  152. //
  153. #if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
  154. # define BOOST_NO_CWCHAR
  155. # define BOOST_NO_CWCTYPE
  156. #endif
  157. //
  158. // If STLport for some reason was configured so that it thinks that wchar_t
  159. // is not an intrinsic type, then we have to disable the support for it as
  160. // well (we would be missing required specializations otherwise).
  161. //
  162. #if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT)
  163. # undef BOOST_NO_INTRINSIC_WCHAR_T
  164. # define BOOST_NO_INTRINSIC_WCHAR_T
  165. #endif
  166. //
  167. // Borland ships a version of STLport with C++ Builder 6 that lacks
  168. // hashtables and the like:
  169. //
  170. #if defined(__BORLANDC__) && (__BORLANDC__ == 0x560)
  171. # undef BOOST_HAS_HASH
  172. #endif
  173. //
  174. // gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
  175. //
  176. #if defined(__GNUC__) && (__GNUC__ < 3)
  177. # include <algorithm> // for std::min and std::max
  178. # define BOOST_USING_STD_MIN() ((void)0)
  179. # define BOOST_USING_STD_MAX() ((void)0)
  180. namespace boost { using std::min; using std::max; }
  181. #endif
  182. // C++0x headers not yet implemented
  183. //
  184. # define BOOST_NO_0X_HDR_ARRAY
  185. # define BOOST_NO_0X_HDR_CHRONO
  186. # define BOOST_NO_0X_HDR_CODECVT
  187. # define BOOST_NO_0X_HDR_CONCEPTS
  188. # define BOOST_NO_0X_HDR_CONDITION_VARIABLE
  189. # define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
  190. # define BOOST_NO_0X_HDR_FORWARD_LIST
  191. # define BOOST_NO_0X_HDR_FUTURE
  192. # define BOOST_NO_0X_HDR_INITIALIZER_LIST
  193. # define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
  194. # define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
  195. # define BOOST_NO_0X_HDR_MUTEX
  196. # define BOOST_NO_0X_HDR_RANDOM
  197. # define BOOST_NO_0X_HDR_RATIO
  198. # define BOOST_NO_0X_HDR_REGEX
  199. # define BOOST_NO_0X_HDR_SYSTEM_ERROR
  200. # define BOOST_NO_0X_HDR_THREAD
  201. # define BOOST_NO_0X_HDR_TUPLE
  202. # define BOOST_NO_0X_HDR_TYPE_TRAITS
  203. # define BOOST_NO_STD_UNORDERED // deprecated; see following
  204. # define BOOST_NO_0X_HDR_UNORDERED_MAP
  205. # define BOOST_NO_0X_HDR_UNORDERED_SET
  206. #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)