stlport.hpp 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. // Apple doesn't seem to reliably defined a *unix* macro
  16. #if !defined(CYGWIN) && ( defined(__unix__) \
  17. || defined(__unix) \
  18. || defined(unix) \
  19. || defined(__APPLE__) \
  20. || defined(__APPLE) \
  21. || defined(APPLE))
  22. # include <unistd.h>
  23. #endif
  24. //
  25. // __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  26. // for versions prior to 4.1(beta)
  27. //
  28. #if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400)
  29. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  30. #endif
  31. //
  32. // If STLport thinks that there is no partial specialisation, then there is no
  33. // std::iterator traits:
  34. //
  35. #if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION))
  36. # define BOOST_NO_STD_ITERATOR_TRAITS
  37. #endif
  38. //
  39. // No new style iostreams on GCC without STLport's iostreams enabled:
  40. //
  41. #if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS))
  42. # define BOOST_NO_STRINGSTREAM
  43. #endif
  44. //
  45. // No new iostreams implies no std::locale, and no std::stringstream:
  46. //
  47. #if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS)
  48. # define BOOST_NO_STD_LOCALE
  49. # define BOOST_NO_STRINGSTREAM
  50. #endif
  51. //
  52. // If the streams are not native, and we have a "using ::x" compiler bug
  53. // then the io stream facets are not available in namespace std::
  54. //
  55. #ifdef _STLPORT_VERSION
  56. # if !(_STLPORT_VERSION >= 0x500) && !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
  57. # define BOOST_NO_STD_LOCALE
  58. # endif
  59. #else
  60. # if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
  61. # define BOOST_NO_STD_LOCALE
  62. # endif
  63. #endif
  64. #if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
  65. # define BOOST_HAS_TR1_UNORDERED_SET
  66. # define BOOST_HAS_TR1_UNORDERED_MAP
  67. #endif
  68. //
  69. // Without member template support enabled, their are no template
  70. // iterate constructors, and no std::allocator:
  71. //
  72. #if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES))
  73. # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
  74. # define BOOST_NO_STD_ALLOCATOR
  75. #endif
  76. //
  77. // however we always have at least a partial allocator:
  78. //
  79. #define BOOST_HAS_PARTIAL_STD_ALLOCATOR
  80. #if !defined(_STLP_MEMBER_TEMPLATE_CLASSES) || defined(_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)
  81. # define BOOST_NO_STD_ALLOCATOR
  82. #endif
  83. #if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
  84. # define BOOST_NO_STD_ALLOCATOR
  85. #endif
  86. //
  87. // If STLport thinks there is no wchar_t at all, then we have to disable
  88. // the support for the relevant specilazations of std:: templates.
  89. //
  90. #if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT)
  91. # ifndef BOOST_NO_STD_WSTRING
  92. # define BOOST_NO_STD_WSTRING
  93. # endif
  94. # ifndef BOOST_NO_STD_WSTREAMBUF
  95. # define BOOST_NO_STD_WSTREAMBUF
  96. # endif
  97. #endif
  98. //
  99. // We always have SGI style hash_set, hash_map, and slist:
  100. //
  101. #ifndef _STLP_NO_EXTENSIONS
  102. #define BOOST_HAS_HASH
  103. #define BOOST_HAS_SLIST
  104. #endif
  105. //
  106. // STLport does a good job of importing names into namespace std::,
  107. // but doesn't always get them all, define BOOST_NO_STDC_NAMESPACE, since our
  108. // workaround does not conflict with STLports:
  109. //
  110. //
  111. // Harold Howe says:
  112. // Borland switched to STLport in BCB6. Defining BOOST_NO_STDC_NAMESPACE with
  113. // BCB6 does cause problems. If we detect C++ Builder, then don't define
  114. // BOOST_NO_STDC_NAMESPACE
  115. //
  116. #if !defined(__BORLANDC__) && !defined(__DMC__)
  117. //
  118. // If STLport is using it's own namespace, and the real names are in
  119. // the global namespace, then we duplicate STLport's using declarations
  120. // (by defining BOOST_NO_STDC_NAMESPACE), we do this because STLport doesn't
  121. // necessarily import all the names we need into namespace std::
  122. //
  123. # if (defined(__STL_IMPORT_VENDOR_CSTD) \
  124. || defined(__STL_USE_OWN_NAMESPACE) \
  125. || defined(_STLP_IMPORT_VENDOR_CSTD) \
  126. || defined(_STLP_USE_OWN_NAMESPACE)) \
  127. && (defined(__STL_VENDOR_GLOBAL_CSTD) || defined (_STLP_VENDOR_GLOBAL_CSTD))
  128. # define BOOST_NO_STDC_NAMESPACE
  129. # define BOOST_NO_EXCEPTION_STD_NAMESPACE
  130. # endif
  131. #elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
  132. // STLport doesn't import std::abs correctly:
  133. #include <stdlib.h>
  134. namespace std { using ::abs; }
  135. // and strcmp/strcpy don't get imported either ('cos they are macros)
  136. #include <string.h>
  137. #ifdef strcpy
  138. # undef strcpy
  139. #endif
  140. #ifdef strcmp
  141. # undef strcmp
  142. #endif
  143. #ifdef _STLP_VENDOR_CSTD
  144. namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; }
  145. #endif
  146. #endif
  147. //
  148. // std::use_facet may be non-standard, uses a class instead:
  149. //
  150. #if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
  151. # define BOOST_NO_STD_USE_FACET
  152. # define BOOST_HAS_STLP_USE_FACET
  153. #endif
  154. //
  155. // If STLport thinks there are no wide functions, <cwchar> etc. is not working; but
  156. // only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import
  157. // into std:: ourselves).
  158. //
  159. #if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
  160. # define BOOST_NO_CWCHAR
  161. # define BOOST_NO_CWCTYPE
  162. #endif
  163. //
  164. // If STLport for some reason was configured so that it thinks that wchar_t
  165. // is not an intrinsic type, then we have to disable the support for it as
  166. // well (we would be missing required specializations otherwise).
  167. //
  168. #if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT)
  169. # undef BOOST_NO_INTRINSIC_WCHAR_T
  170. # define BOOST_NO_INTRINSIC_WCHAR_T
  171. #endif
  172. //
  173. // Borland ships a version of STLport with C++ Builder 6 that lacks
  174. // hashtables and the like:
  175. //
  176. #if defined(__BORLANDC__) && (__BORLANDC__ == 0x560)
  177. # undef BOOST_HAS_HASH
  178. #endif
  179. //
  180. // gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
  181. //
  182. #if defined(__GNUC__) && (__GNUC__ < 3)
  183. # include <algorithm> // for std::min and std::max
  184. # define BOOST_USING_STD_MIN() ((void)0)
  185. # define BOOST_USING_STD_MAX() ((void)0)
  186. namespace boost { using std::min; using std::max; }
  187. #endif
  188. // C++0x headers not yet implemented
  189. //
  190. # define BOOST_NO_CXX11_HDR_ARRAY
  191. # define BOOST_NO_CXX11_HDR_CHRONO
  192. # define BOOST_NO_CXX11_HDR_CODECVT
  193. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  194. # define BOOST_NO_CXX11_HDR_FORWARD_LIST
  195. # define BOOST_NO_CXX11_HDR_FUTURE
  196. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  197. # define BOOST_NO_CXX11_HDR_MUTEX
  198. # define BOOST_NO_CXX11_HDR_RANDOM
  199. # define BOOST_NO_CXX11_HDR_RATIO
  200. # define BOOST_NO_CXX11_HDR_REGEX
  201. # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
  202. # define BOOST_NO_CXX11_HDR_THREAD
  203. # define BOOST_NO_CXX11_HDR_TUPLE
  204. # define BOOST_NO_CXX11_HDR_TYPE_TRAITS
  205. # define BOOST_NO_CXX11_HDR_TYPEINDEX
  206. # define BOOST_NO_CXX11_HDR_UNORDERED_MAP
  207. # define BOOST_NO_CXX11_HDR_UNORDERED_SET
  208. # define BOOST_NO_CXX11_NUMERIC_LIMITS
  209. # define BOOST_NO_CXX11_ALLOCATOR
  210. # define BOOST_NO_CXX11_POINTER_TRAITS
  211. # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
  212. # define BOOST_NO_CXX11_SMART_PTR
  213. # define BOOST_NO_CXX11_HDR_FUNCTIONAL
  214. # define BOOST_NO_CXX11_HDR_ATOMIC
  215. # define BOOST_NO_CXX11_STD_ALIGN
  216. # define BOOST_NO_CXX11_ADDRESSOF
  217. #if defined(__has_include)
  218. #if !__has_include(<shared_mutex>)
  219. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  220. #elif __cplusplus < 201402
  221. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  222. #endif
  223. #else
  224. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  225. #endif
  226. // C++14 features
  227. # define BOOST_NO_CXX14_STD_EXCHANGE
  228. // C++17 features
  229. # define BOOST_NO_CXX17_STD_APPLY
  230. # define BOOST_NO_CXX17_STD_INVOKE
  231. # define BOOST_NO_CXX17_ITERATOR_TRAITS
  232. #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)