visualc.hpp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright Darin Adler 2001 - 2002.
  3. // (C) Copyright Peter Dimov 2001.
  4. // (C) Copyright Aleksey Gurtovoy 2002.
  5. // (C) Copyright David Abrahams 2002 - 2003.
  6. // (C) Copyright Beman Dawes 2002 - 2003.
  7. // Use, modification and distribution are subject to the
  8. // Boost Software License, Version 1.0. (See accompanying file
  9. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  10. // See http://www.boost.org for most recent version.
  11. //
  12. // Microsoft Visual C++ compiler setup:
  13. //
  14. // We need to be careful with the checks in this file, as contrary
  15. // to popular belief there are versions with _MSC_VER with the final
  16. // digit non-zero (mainly the MIPS cross compiler).
  17. //
  18. // So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
  19. // No other comparisons (==, >, or <=) are safe.
  20. //
  21. #define BOOST_MSVC _MSC_VER
  22. //
  23. // Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
  24. //
  25. #if _MSC_FULL_VER > 100000000
  26. # define BOOST_MSVC_FULL_VER _MSC_FULL_VER
  27. #else
  28. # define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
  29. #endif
  30. // Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
  31. #pragma warning( disable : 4503 ) // warning: decorated name length exceeded
  32. #define BOOST_HAS_PRAGMA_ONCE
  33. //
  34. // versions check:
  35. // we don't support Visual C++ prior to version 7.1:
  36. #if _MSC_VER < 1310
  37. # error "Compiler not supported or configured - please reconfigure"
  38. #endif
  39. #if _MSC_FULL_VER < 180020827
  40. # define BOOST_NO_FENV_H
  41. #endif
  42. #if _MSC_VER < 1400
  43. // although a conforming signature for swprint exists in VC7.1
  44. // it appears not to actually work:
  45. # define BOOST_NO_SWPRINTF
  46. // Our extern template tests also fail for this compiler:
  47. # define BOOST_NO_CXX11_EXTERN_TEMPLATE
  48. // Variadic macros do not exist for VC7.1 and lower
  49. # define BOOST_NO_CXX11_VARIADIC_MACROS
  50. #endif
  51. #if defined(UNDER_CE)
  52. // Windows CE does not have a conforming signature for swprintf
  53. # define BOOST_NO_SWPRINTF
  54. #endif
  55. #if _MSC_VER < 1500 // 140X == VC++ 8.0
  56. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  57. #endif
  58. #if _MSC_VER < 1600 // 150X == VC++ 9.0
  59. // A bug in VC9:
  60. # define BOOST_NO_ADL_BARRIER
  61. #endif
  62. // MSVC (including the latest checked version) has not yet completely
  63. // implemented value-initialization, as is reported:
  64. // "VC++ does not value-initialize members of derived classes without
  65. // user-declared constructor", reported in 2009 by Sylvester Hesp:
  66. // https://connect.microsoft.com/VisualStudio/feedback/details/484295
  67. // "Presence of copy constructor breaks member class initialization",
  68. // reported in 2009 by Alex Vakulenko:
  69. // https://connect.microsoft.com/VisualStudio/feedback/details/499606
  70. // "Value-initialization in new-expression", reported in 2005 by
  71. // Pavel Kuznetsov (MetaCommunications Engineering):
  72. // https://connect.microsoft.com/VisualStudio/feedback/details/100744
  73. // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
  74. // (Niels Dekker, LKEB, May 2010)
  75. # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
  76. #ifndef _NATIVE_WCHAR_T_DEFINED
  77. # define BOOST_NO_INTRINSIC_WCHAR_T
  78. #endif
  79. #if defined(_WIN32_WCE) || defined(UNDER_CE)
  80. # define BOOST_NO_SWPRINTF
  81. #endif
  82. // we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE
  83. #if !defined(_WIN32_WCE) && !defined(UNDER_CE)
  84. # define BOOST_HAS_THREADEX
  85. # define BOOST_HAS_GETSYSTEMTIMEASFILETIME
  86. #endif
  87. //
  88. // check for exception handling support:
  89. #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
  90. # define BOOST_NO_EXCEPTIONS
  91. #endif
  92. //
  93. // __int64 support:
  94. //
  95. #define BOOST_HAS_MS_INT64
  96. #if defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)
  97. # define BOOST_HAS_LONG_LONG
  98. #else
  99. # define BOOST_NO_LONG_LONG
  100. #endif
  101. #if (_MSC_VER >= 1400) && !defined(_DEBUG)
  102. # define BOOST_HAS_NRVO
  103. #endif
  104. //
  105. // disable Win32 API's if compiler extentions are
  106. // turned off:
  107. //
  108. #if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
  109. # define BOOST_DISABLE_WIN32
  110. #endif
  111. #if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
  112. # define BOOST_NO_RTTI
  113. #endif
  114. //
  115. // TR1 features:
  116. //
  117. #if _MSC_VER >= 1700
  118. // # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
  119. // # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
  120. # define BOOST_HAS_TR1_UNORDERED_MAP
  121. # define BOOST_HAS_TR1_UNORDERED_SET
  122. #endif
  123. //
  124. // C++0x features
  125. //
  126. // See above for BOOST_NO_LONG_LONG
  127. // C++ features supported by VC++ 10 (aka 2010)
  128. //
  129. #if _MSC_VER < 1600
  130. # define BOOST_NO_CXX11_AUTO_DECLARATIONS
  131. # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
  132. # define BOOST_NO_CXX11_LAMBDAS
  133. # define BOOST_NO_CXX11_RVALUE_REFERENCES
  134. # define BOOST_NO_CXX11_STATIC_ASSERT
  135. # define BOOST_NO_CXX11_NULLPTR
  136. # define BOOST_NO_CXX11_DECLTYPE
  137. #endif // _MSC_VER < 1600
  138. #if _MSC_VER >= 1600
  139. # define BOOST_HAS_STDINT_H
  140. #endif
  141. // C++11 features supported by VC++ 11 (aka 2012)
  142. //
  143. #if _MSC_VER < 1700
  144. # define BOOST_NO_CXX11_RANGE_BASED_FOR
  145. # define BOOST_NO_CXX11_SCOPED_ENUMS
  146. #endif // _MSC_VER < 1700
  147. // C++11 features supported by VC++ 12 (aka 2013).
  148. //
  149. #if _MSC_FULL_VER < 180020827
  150. # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
  151. # define BOOST_NO_CXX11_DELETED_FUNCTIONS
  152. # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
  153. # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
  154. # define BOOST_NO_CXX11_RAW_LITERALS
  155. # define BOOST_NO_CXX11_TEMPLATE_ALIASES
  156. # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
  157. # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
  158. # define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
  159. #endif
  160. // C++11 features not supported by any versions
  161. #define BOOST_NO_CXX11_CHAR16_T
  162. #define BOOST_NO_CXX11_CHAR32_T
  163. #define BOOST_NO_CXX11_CONSTEXPR
  164. #define BOOST_NO_CXX11_DECLTYPE_N3276
  165. #define BOOST_NO_CXX11_NOEXCEPT
  166. #define BOOST_NO_CXX11_UNICODE_LITERALS
  167. #define BOOST_NO_SFINAE_EXPR
  168. #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  169. #define BOOST_NO_CXX11_USER_DEFINED_LITERALS
  170. #define BOOST_NO_CXX11_ALIGNAS
  171. #define BOOST_NO_CXX11_INLINE_NAMESPACES
  172. //
  173. // prefix and suffix headers:
  174. //
  175. #ifndef BOOST_ABI_PREFIX
  176. # define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
  177. #endif
  178. #ifndef BOOST_ABI_SUFFIX
  179. # define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
  180. #endif
  181. #ifndef BOOST_COMPILER
  182. // TODO:
  183. // these things are mostly bogus. 1200 means version 12.0 of the compiler. The
  184. // artificial versions assigned to them only refer to the versions of some IDE
  185. // these compilers have been shipped with, and even that is not all of it. Some
  186. // were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
  187. // IOW, you can't use these 'versions' in any sensible way. Sorry.
  188. # if defined(UNDER_CE)
  189. # if _MSC_VER < 1400
  190. // Note: I'm not aware of any CE compiler with version 13xx
  191. # if defined(BOOST_ASSERT_CONFIG)
  192. # error "Unknown EVC++ compiler version - please run the configure tests and report the results"
  193. # else
  194. # pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
  195. # endif
  196. # elif _MSC_VER < 1500
  197. # define BOOST_COMPILER_VERSION evc8
  198. # elif _MSC_VER < 1600
  199. # define BOOST_COMPILER_VERSION evc9
  200. # elif _MSC_VER < 1700
  201. # define BOOST_COMPILER_VERSION evc10
  202. # elif _MSC_VER < 1800
  203. # define BOOST_COMPILER_VERSION evc11
  204. # elif _MSC_VER < 1900
  205. # define BOOST_COMPILER_VERSION evc12
  206. # else
  207. # if defined(BOOST_ASSERT_CONFIG)
  208. # error "Unknown EVC++ compiler version - please run the configure tests and report the results"
  209. # else
  210. # pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
  211. # endif
  212. # endif
  213. # else
  214. # if _MSC_VER < 1310
  215. // Note: Versions up to 7.0 aren't supported.
  216. # define BOOST_COMPILER_VERSION 5.0
  217. # elif _MSC_VER < 1300
  218. # define BOOST_COMPILER_VERSION 6.0
  219. # elif _MSC_VER < 1310
  220. # define BOOST_COMPILER_VERSION 7.0
  221. # elif _MSC_VER < 1400
  222. # define BOOST_COMPILER_VERSION 7.1
  223. # elif _MSC_VER < 1500
  224. # define BOOST_COMPILER_VERSION 8.0
  225. # elif _MSC_VER < 1600
  226. # define BOOST_COMPILER_VERSION 9.0
  227. # elif _MSC_VER < 1700
  228. # define BOOST_COMPILER_VERSION 10.0
  229. # elif _MSC_VER < 1800
  230. # define BOOST_COMPILER_VERSION 11.0
  231. # elif _MSC_VER < 1900
  232. # define BOOST_COMPILER_VERSION 12.0
  233. # else
  234. # define BOOST_COMPILER_VERSION _MSC_VER
  235. # endif
  236. # endif
  237. # define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
  238. #endif
  239. //
  240. // last known and checked version is 18.00.20827.3 (VC12 RC, aka 2013 RC):
  241. #if (_MSC_VER > 1800 && _MSC_FULL_VER > 180020827)
  242. # if defined(BOOST_ASSERT_CONFIG)
  243. # error "Unknown compiler version - please run the configure tests and report the results"
  244. # else
  245. # pragma message("Unknown compiler version - please run the configure tests and report the results")
  246. # endif
  247. #endif