dinkumware.hpp 9.4 KB

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