dinkumware.hpp 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright Jens Maurer 2001.
  3. // (C) Copyright Peter Dimov 2001.
  4. // (C) Copyright David Abrahams 2002.
  5. // (C) Copyright Guillaume Melquiond 2003.
  6. // Use, modification and distribution are subject to the
  7. // Boost Software License, Version 1.0. (See accompanying file
  8. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. // See http://www.boost.org for most recent version.
  10. // Dinkumware standard library config:
  11. #if !defined(_YVALS) && !defined(_CPPLIB_VER)
  12. #include <boost/config/no_tr1/utility.hpp>
  13. #if !defined(_YVALS) && !defined(_CPPLIB_VER)
  14. #error This is not the Dinkumware lib!
  15. #endif
  16. #endif
  17. #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
  18. // full dinkumware 3.06 and above
  19. // fully conforming provided the compiler supports it:
  20. # if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(__BORLANDC__) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h
  21. # define BOOST_NO_STDC_NAMESPACE
  22. # endif
  23. # if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300)) && defined(BOOST_MSVC)
  24. # define BOOST_NO_STD_ALLOCATOR
  25. # endif
  26. # define BOOST_HAS_PARTIAL_STD_ALLOCATOR
  27. # if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
  28. // if this lib version is set up for vc6 then there is no std::use_facet:
  29. # define BOOST_NO_STD_USE_FACET
  30. # define BOOST_HAS_TWO_ARG_USE_FACET
  31. // C lib functions aren't in namespace std either:
  32. # define BOOST_NO_STDC_NAMESPACE
  33. // and nor is <exception>
  34. # define BOOST_NO_EXCEPTION_STD_NAMESPACE
  35. # endif
  36. // There's no numeric_limits<long long> support unless _LONGLONG is defined:
  37. # if !defined(_LONGLONG) && (_CPPLIB_VER <= 310)
  38. # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
  39. # endif
  40. // 3.06 appears to have (non-sgi versions of) <hash_set> & <hash_map>,
  41. // and no <slist> at all
  42. #else
  43. # define BOOST_MSVC_STD_ITERATOR 1
  44. # define BOOST_NO_STD_ITERATOR
  45. # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
  46. # define BOOST_NO_STD_ALLOCATOR
  47. # define BOOST_NO_STDC_NAMESPACE
  48. # define BOOST_NO_STD_USE_FACET
  49. # define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
  50. # define BOOST_HAS_MACRO_USE_FACET
  51. # ifndef _CPPLIB_VER
  52. // Updated Dinkum library defines this, and provides
  53. // its own min and max definitions, as does MTA version.
  54. # ifndef __MTA__
  55. # define BOOST_NO_STD_MIN_MAX
  56. # endif
  57. # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
  58. # endif
  59. #endif
  60. //
  61. // std extension namespace is stdext for vc7.1 and later,
  62. // the same applies to other compilers that sit on top
  63. // of vc7.1 (Intel and Comeau):
  64. //
  65. #if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(__BORLANDC__)
  66. # define BOOST_STD_EXTENSION_NAMESPACE stdext
  67. #endif
  68. #if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
  69. // if we're using a dinkum lib that's
  70. // been configured for VC6/7 then there is
  71. // no iterator traits (true even for icl)
  72. # define BOOST_NO_STD_ITERATOR_TRAITS
  73. #endif
  74. #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
  75. // Intel C++ chokes over any non-trivial use of <locale>
  76. // this may be an overly restrictive define, but regex fails without it:
  77. # define BOOST_NO_STD_LOCALE
  78. #endif
  79. // Fix for VC++ 8.0 on up ( I do not have a previous version to test )
  80. // or clang-cl. If exceptions are off you must manually include the
  81. // <exception> header before including the <typeinfo> header. Admittedly
  82. // trying to use Boost libraries or the standard C++ libraries without
  83. // exception support is not suggested but currently clang-cl ( v 3.4 )
  84. // does not support exceptions and must be compiled with exceptions off.
  85. #if !_HAS_EXCEPTIONS && ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER)))
  86. #include <exception>
  87. #endif
  88. #include <typeinfo>
  89. #if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (defined(__ghs__) && !_HAS_NAMESPACE) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) \
  90. && !defined(__VXWORKS__)
  91. # define BOOST_NO_STD_TYPEINFO
  92. #endif
  93. // C++0x headers implemented in 520 (as shipped by Microsoft)
  94. //
  95. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
  96. # define BOOST_NO_CXX11_HDR_ARRAY
  97. # define BOOST_NO_CXX11_HDR_CODECVT
  98. # define BOOST_NO_CXX11_HDR_FORWARD_LIST
  99. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  100. # define BOOST_NO_CXX11_HDR_RANDOM
  101. # define BOOST_NO_CXX11_HDR_REGEX
  102. # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
  103. # define BOOST_NO_CXX11_HDR_UNORDERED_MAP
  104. # define BOOST_NO_CXX11_HDR_UNORDERED_SET
  105. # define BOOST_NO_CXX11_HDR_TUPLE
  106. # define BOOST_NO_CXX11_HDR_TYPEINDEX
  107. # define BOOST_NO_CXX11_HDR_FUNCTIONAL
  108. # define BOOST_NO_CXX11_NUMERIC_LIMITS
  109. # define BOOST_NO_CXX11_SMART_PTR
  110. #endif
  111. #if ((!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(BOOST_NO_CXX11_HDR_TUPLE)) \
  112. && (!defined(_CPPLIB_VER) || _CPPLIB_VER < 610)
  113. # define BOOST_NO_CXX11_HDR_TUPLE
  114. #endif
  115. // C++0x headers implemented in 540 (as shipped by Microsoft)
  116. //
  117. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 540
  118. # define BOOST_NO_CXX11_HDR_TYPE_TRAITS
  119. # define BOOST_NO_CXX11_HDR_CHRONO
  120. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  121. # define BOOST_NO_CXX11_HDR_FUTURE
  122. # define BOOST_NO_CXX11_HDR_MUTEX
  123. # define BOOST_NO_CXX11_HDR_RATIO
  124. # define BOOST_NO_CXX11_HDR_THREAD
  125. # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
  126. #endif
  127. // C++0x headers implemented in 610 (as shipped by Microsoft)
  128. //
  129. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610
  130. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  131. # define BOOST_NO_CXX11_HDR_ATOMIC
  132. # define BOOST_NO_CXX11_ALLOCATOR
  133. // 540 has std::align but it is not a conforming implementation
  134. # define BOOST_NO_CXX11_STD_ALIGN
  135. #endif
  136. // Before 650 std::pointer_traits has a broken rebind template
  137. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  138. # define BOOST_NO_CXX11_POINTER_TRAITS
  139. #elif defined(BOOST_MSVC) && BOOST_MSVC < 1910
  140. # define BOOST_NO_CXX11_POINTER_TRAITS
  141. #endif
  142. #if defined(__has_include)
  143. #if !__has_include(<shared_mutex>)
  144. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  145. #elif (__cplusplus < 201402) && !defined(_MSC_VER)
  146. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  147. #endif
  148. #elif !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  149. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  150. #endif
  151. // C++14 features
  152. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  153. # define BOOST_NO_CXX14_STD_EXCHANGE
  154. #endif
  155. // C++17 features
  156. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
  157. # define BOOST_NO_CXX17_STD_APPLY
  158. # define BOOST_NO_CXX17_ITERATOR_TRAITS
  159. # define BOOST_NO_CXX17_HDR_STRING_VIEW
  160. # define BOOST_NO_CXX17_HDR_OPTIONAL
  161. # define BOOST_NO_CXX17_HDR_VARIANT
  162. #endif
  163. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) || !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 201709)
  164. # define BOOST_NO_CXX17_STD_INVOKE
  165. #endif
  166. #if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0))
  167. // Deprecated std::iterator:
  168. # define BOOST_NO_STD_ITERATOR
  169. #endif
  170. #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400)
  171. // Intel's compiler can't handle this header yet:
  172. # define BOOST_NO_CXX11_HDR_ATOMIC
  173. #endif
  174. // 520..610 have std::addressof, but it doesn't support functions
  175. //
  176. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  177. # define BOOST_NO_CXX11_ADDRESSOF
  178. #endif
  179. // Bug specific to VC14,
  180. // See https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t
  181. // and discussion here: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/visual-studio-2015-preview-now-available.aspx?PageIndex=2
  182. #if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650)
  183. # define BOOST_NO_CXX11_HDR_CODECVT
  184. #endif
  185. #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 650)
  186. // If _HAS_AUTO_PTR_ETC is defined to 0, std::auto_ptr and std::random_shuffle are not available.
  187. // See https://www.visualstudio.com/en-us/news/vs2015-vs.aspx#C++
  188. // and http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
  189. # if defined(_HAS_AUTO_PTR_ETC) && (_HAS_AUTO_PTR_ETC == 0)
  190. # define BOOST_NO_AUTO_PTR
  191. # define BOOST_NO_CXX98_RANDOM_SHUFFLE
  192. # define BOOST_NO_CXX98_FUNCTION_BASE
  193. # define BOOST_NO_CXX98_BINDERS
  194. # endif
  195. #endif
  196. //
  197. // Things not supported by the CLR:
  198. #ifdef _M_CEE
  199. #ifndef BOOST_NO_CXX11_HDR_MUTEX
  200. # define BOOST_NO_CXX11_HDR_MUTEX
  201. #endif
  202. #ifndef BOOST_NO_CXX11_HDR_ATOMIC
  203. # define BOOST_NO_CXX11_HDR_ATOMIC
  204. #endif
  205. #ifndef BOOST_NO_CXX11_HDR_FUTURE
  206. # define BOOST_NO_CXX11_HDR_FUTURE
  207. #endif
  208. #ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  209. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  210. #endif
  211. #ifndef BOOST_NO_CXX11_HDR_THREAD
  212. # define BOOST_NO_CXX11_HDR_THREAD
  213. #endif
  214. #ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX
  215. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  216. #endif
  217. #ifndef BOOST_NO_CXX14_STD_EXCHANGE
  218. # define BOOST_NO_CXX14_STD_EXCHANGE
  219. #endif
  220. #ifndef BOOST_NO_FENV_H
  221. # define BOOST_NO_FENV_H
  222. #endif
  223. #endif
  224. #ifdef _CPPLIB_VER
  225. # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
  226. #else
  227. # define BOOST_DINKUMWARE_STDLIB 1
  228. #endif
  229. #ifdef _CPPLIB_VER
  230. # define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER)
  231. #else
  232. # define BOOST_STDLIB "Dinkumware standard library version 1.x"
  233. #endif