dinkumware.hpp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. #if BOOST_MSVC < 1800
  80. // Fix for VC++ 8.0 on up ( I do not have a previous version to test )
  81. // or clang-cl. If exceptions are off you must manually include the
  82. // <exception> header before including the <typeinfo> header. Admittedly
  83. // trying to use Boost libraries or the standard C++ libraries without
  84. // exception support is not suggested but currently clang-cl ( v 3.4 )
  85. // does not support exceptions and must be compiled with exceptions off.
  86. #if !_HAS_EXCEPTIONS && ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER)))
  87. #include <exception>
  88. #endif
  89. #include <typeinfo>
  90. #if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (defined(__ghs__) && !_HAS_NAMESPACE) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) \
  91. && !defined(__VXWORKS__)
  92. # define BOOST_NO_STD_TYPEINFO
  93. #endif
  94. #endif
  95. // C++0x headers implemented in 520 (as shipped by Microsoft)
  96. //
  97. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
  98. # define BOOST_NO_CXX11_HDR_ARRAY
  99. # define BOOST_NO_CXX11_HDR_CODECVT
  100. # define BOOST_NO_CXX11_HDR_FORWARD_LIST
  101. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  102. # define BOOST_NO_CXX11_HDR_RANDOM
  103. # define BOOST_NO_CXX11_HDR_REGEX
  104. # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
  105. # define BOOST_NO_CXX11_HDR_UNORDERED_MAP
  106. # define BOOST_NO_CXX11_HDR_UNORDERED_SET
  107. # define BOOST_NO_CXX11_HDR_TUPLE
  108. # define BOOST_NO_CXX11_HDR_TYPEINDEX
  109. # define BOOST_NO_CXX11_HDR_FUNCTIONAL
  110. # define BOOST_NO_CXX11_NUMERIC_LIMITS
  111. # define BOOST_NO_CXX11_SMART_PTR
  112. #endif
  113. #if ((!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(BOOST_NO_CXX11_HDR_TUPLE)) \
  114. && (!defined(_CPPLIB_VER) || _CPPLIB_VER < 610)
  115. # define BOOST_NO_CXX11_HDR_TUPLE
  116. #endif
  117. // C++0x headers implemented in 540 (as shipped by Microsoft)
  118. //
  119. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 540
  120. # define BOOST_NO_CXX11_HDR_TYPE_TRAITS
  121. # define BOOST_NO_CXX11_HDR_CHRONO
  122. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  123. # define BOOST_NO_CXX11_HDR_FUTURE
  124. # define BOOST_NO_CXX11_HDR_MUTEX
  125. # define BOOST_NO_CXX11_HDR_RATIO
  126. # define BOOST_NO_CXX11_HDR_THREAD
  127. # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
  128. # define BOOST_NO_CXX11_HDR_EXCEPTION
  129. #endif
  130. // C++0x headers implemented in 610 (as shipped by Microsoft)
  131. //
  132. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610
  133. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  134. # define BOOST_NO_CXX11_HDR_ATOMIC
  135. # define BOOST_NO_CXX11_ALLOCATOR
  136. // 540 has std::align but it is not a conforming implementation
  137. # define BOOST_NO_CXX11_STD_ALIGN
  138. #endif
  139. // Before 650 std::pointer_traits has a broken rebind template
  140. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  141. # define BOOST_NO_CXX11_POINTER_TRAITS
  142. #elif defined(BOOST_MSVC) && BOOST_MSVC < 1910
  143. # define BOOST_NO_CXX11_POINTER_TRAITS
  144. #endif
  145. #if defined(__has_include)
  146. #if !__has_include(<shared_mutex>)
  147. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  148. #elif (__cplusplus < 201402) && !defined(_MSC_VER)
  149. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  150. #endif
  151. #elif !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  152. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  153. #endif
  154. // C++14 features
  155. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
  156. # define BOOST_NO_CXX14_STD_EXCHANGE
  157. #endif
  158. // C++17 features
  159. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
  160. # define BOOST_NO_CXX17_STD_APPLY
  161. # define BOOST_NO_CXX17_ITERATOR_TRAITS
  162. # define BOOST_NO_CXX17_HDR_STRING_VIEW
  163. # define BOOST_NO_CXX17_HDR_OPTIONAL
  164. # define BOOST_NO_CXX17_HDR_VARIANT
  165. #endif
  166. #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) || !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 201709)
  167. # define BOOST_NO_CXX17_STD_INVOKE
  168. #endif
  169. #if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0))
  170. // Deprecated std::iterator:
  171. # define BOOST_NO_STD_ITERATOR
  172. #endif
  173. #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400)
  174. // Intel's compiler can't handle this header yet:
  175. # define BOOST_NO_CXX11_HDR_ATOMIC
  176. #endif
  177. // 520..610 have std::addressof, but it doesn't support functions
  178. //
  179. #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 650
  180. # define BOOST_NO_CXX11_ADDRESSOF
  181. #endif
  182. // Bug specific to VC14,
  183. // See https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t
  184. // and discussion here: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/visual-studio-2015-preview-now-available.aspx?PageIndex=2
  185. #if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650)
  186. # define BOOST_NO_CXX11_HDR_CODECVT
  187. #endif
  188. #if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 650)
  189. // If _HAS_AUTO_PTR_ETC is defined to 0, std::auto_ptr and std::random_shuffle are not available.
  190. // See https://www.visualstudio.com/en-us/news/vs2015-vs.aspx#C++
  191. // and http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
  192. # if defined(_HAS_AUTO_PTR_ETC) && (_HAS_AUTO_PTR_ETC == 0)
  193. # define BOOST_NO_AUTO_PTR
  194. # define BOOST_NO_CXX98_RANDOM_SHUFFLE
  195. # define BOOST_NO_CXX98_FUNCTION_BASE
  196. # define BOOST_NO_CXX98_BINDERS
  197. # endif
  198. #endif
  199. //
  200. // Things not supported by the CLR:
  201. #ifdef _M_CEE
  202. #ifndef BOOST_NO_CXX11_HDR_MUTEX
  203. # define BOOST_NO_CXX11_HDR_MUTEX
  204. #endif
  205. #ifndef BOOST_NO_CXX11_HDR_ATOMIC
  206. # define BOOST_NO_CXX11_HDR_ATOMIC
  207. #endif
  208. #ifndef BOOST_NO_CXX11_HDR_FUTURE
  209. # define BOOST_NO_CXX11_HDR_FUTURE
  210. #endif
  211. #ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  212. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  213. #endif
  214. #ifndef BOOST_NO_CXX11_HDR_THREAD
  215. # define BOOST_NO_CXX11_HDR_THREAD
  216. #endif
  217. #ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX
  218. # define BOOST_NO_CXX14_HDR_SHARED_MUTEX
  219. #endif
  220. #ifndef BOOST_NO_CXX14_STD_EXCHANGE
  221. # define BOOST_NO_CXX14_STD_EXCHANGE
  222. #endif
  223. #ifndef BOOST_NO_FENV_H
  224. # define BOOST_NO_FENV_H
  225. #endif
  226. #endif
  227. #ifdef _CPPLIB_VER
  228. # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
  229. #else
  230. # define BOOST_DINKUMWARE_STDLIB 1
  231. #endif
  232. #ifdef _CPPLIB_VER
  233. # define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER)
  234. #else
  235. # define BOOST_STDLIB "Dinkumware standard library version 1.x"
  236. #endif