dinkumware.hpp 9.3 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. # define BOOST_NO_CXX11_HDR_EXCEPTION
  127. #endif
  128. // C++0x headers implemented in 610 (as shipped by Microsoft)
  129. //
  130. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610
  131. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  132. # define BOOST_NO_CXX11_HDR_ATOMIC
  133. # define BOOST_NO_CXX11_ALLOCATOR
  134. // 540 has std::align but it is not a conforming implementation
  135. # define BOOST_NO_CXX11_STD_ALIGN
  136. #endif
  137. // Before 650 std::pointer_traits has a broken rebind template
  138. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  139. # define BOOST_NO_CXX11_POINTER_TRAITS
  140. #elif defined(BOOST_MSVC) && BOOST_MSVC < 1910
  141. # define BOOST_NO_CXX11_POINTER_TRAITS
  142. #endif
  143. #if defined(__has_include)
  144. #if !__has_include(<shared_mutex>)
  145. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  146. #elif (__cplusplus < 201402) && !defined(_MSC_VER)
  147. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  148. #endif
  149. #elif !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  150. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  151. #endif
  152. // C++14 features
  153. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  154. # define BOOST_NO_CXX14_STD_EXCHANGE
  155. #endif
  156. // C++17 features
  157. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
  158. # define BOOST_NO_CXX17_STD_APPLY
  159. # define BOOST_NO_CXX17_ITERATOR_TRAITS
  160. # define BOOST_NO_CXX17_HDR_STRING_VIEW
  161. # define BOOST_NO_CXX17_HDR_OPTIONAL
  162. # define BOOST_NO_CXX17_HDR_VARIANT
  163. #endif
  164. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) || !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 201709)
  165. # define BOOST_NO_CXX17_STD_INVOKE
  166. #endif
  167. #if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0))
  168. // Deprecated std::iterator:
  169. # define BOOST_NO_STD_ITERATOR
  170. #endif
  171. #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400)
  172. // Intel's compiler can't handle this header yet:
  173. # define BOOST_NO_CXX11_HDR_ATOMIC
  174. #endif
  175. // 520..610 have std::addressof, but it doesn't support functions
  176. //
  177. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  178. # define BOOST_NO_CXX11_ADDRESSOF
  179. #endif
  180. // Bug specific to VC14,
  181. // See https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t
  182. // and discussion here: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/visual-studio-2015-preview-now-available.aspx?PageIndex=2
  183. #if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650)
  184. # define BOOST_NO_CXX11_HDR_CODECVT
  185. #endif
  186. #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 650)
  187. // If _HAS_AUTO_PTR_ETC is defined to 0, std::auto_ptr and std::random_shuffle are not available.
  188. // See https://www.visualstudio.com/en-us/news/vs2015-vs.aspx#C++
  189. // and http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
  190. # if defined(_HAS_AUTO_PTR_ETC) && (_HAS_AUTO_PTR_ETC == 0)
  191. # define BOOST_NO_AUTO_PTR
  192. # define BOOST_NO_CXX98_RANDOM_SHUFFLE
  193. # define BOOST_NO_CXX98_FUNCTION_BASE
  194. # define BOOST_NO_CXX98_BINDERS
  195. # endif
  196. #endif
  197. //
  198. // Things not supported by the CLR:
  199. #ifdef _M_CEE
  200. #ifndef BOOST_NO_CXX11_HDR_MUTEX
  201. # define BOOST_NO_CXX11_HDR_MUTEX
  202. #endif
  203. #ifndef BOOST_NO_CXX11_HDR_ATOMIC
  204. # define BOOST_NO_CXX11_HDR_ATOMIC
  205. #endif
  206. #ifndef BOOST_NO_CXX11_HDR_FUTURE
  207. # define BOOST_NO_CXX11_HDR_FUTURE
  208. #endif
  209. #ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  210. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  211. #endif
  212. #ifndef BOOST_NO_CXX11_HDR_THREAD
  213. # define BOOST_NO_CXX11_HDR_THREAD
  214. #endif
  215. #ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX
  216. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  217. #endif
  218. #ifndef BOOST_NO_CXX14_STD_EXCHANGE
  219. # define BOOST_NO_CXX14_STD_EXCHANGE
  220. #endif
  221. #ifndef BOOST_NO_FENV_H
  222. # define BOOST_NO_FENV_H
  223. #endif
  224. #endif
  225. #ifdef _CPPLIB_VER
  226. # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
  227. #else
  228. # define BOOST_DINKUMWARE_STDLIB 1
  229. #endif
  230. #ifdef _CPPLIB_VER
  231. # define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER)
  232. #else
  233. # define BOOST_STDLIB "Dinkumware standard library version 1.x"
  234. #endif