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 
11 //  See http://www.boost.org for most recent version.
12 //
13 //  Microsoft Visual C++ compiler setup:
14 //
15 //  We need to be careful with the checks in this file, as contrary
16 //  to popular belief there are versions with _MSC_VER with the final
17 //  digit non-zero (mainly the MIPS cross compiler).
18 //
19 //  So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
20 //  No other comparisons (==, >, or <=) are safe.
21 //
22 
23 #define BOOST_MSVC _MSC_VER
24 
25 //
26 // Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
27 //
28 #if _MSC_FULL_VER > 100000000
29 #  define BOOST_MSVC_FULL_VER _MSC_FULL_VER
30 #else
31 #  define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
32 #endif
33 
34 // Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
35 #pragma warning( disable : 4503 ) // warning: decorated name length exceeded
36 
37 //
38 // versions check:
39 // we don't support Visual C++ prior to version 6:
40 #if _MSC_VER < 1200
41 #  error "Compiler not supported or configured - please reconfigure"
42 #endif
43 
44 #if _MSC_VER < 1300  // 1200 == VC++ 6.0, 1200-1202 == eVC++4
45 #  pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
46 #  define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
47 #  define BOOST_NO_VOID_RETURNS
48 #  define BOOST_NO_EXCEPTION_STD_NAMESPACE
49 
50 #  if _MSC_VER == 1202
51 #    define BOOST_NO_STD_TYPEINFO
52 #  endif
53 
54 #endif
55 
56 /// Visual Studio has no fenv.h
57 #define BOOST_NO_FENV_H
58 
59 #if (_MSC_VER < 1310)  // 130X == VC++ 7.0
60 
61 #  if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS)      // VC7 bug with /Za
62 #    define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
63 #  endif
64 
65 #  define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
66 #  define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
67 #  define BOOST_NO_PRIVATE_IN_AGGREGATE
68 #  define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
69 #  define BOOST_NO_INTEGRAL_INT64_T
70 #  define BOOST_NO_DEDUCED_TYPENAME
71 #  define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
72 
73 //    VC++ 6/7 has member templates but they have numerous problems including
74 //    cases of silent failure, so for safety we define:
75 #  define BOOST_NO_MEMBER_TEMPLATES
76 //    For VC++ experts wishing to attempt workarounds, we define:
77 #  define BOOST_MSVC6_MEMBER_TEMPLATES
78 
79 #  define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
80 #  define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
81 #  define BOOST_NO_CV_VOID_SPECIALIZATIONS
82 #  define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
83 #  define BOOST_NO_USING_TEMPLATE
84 #  define BOOST_NO_SWPRINTF
85 #  define BOOST_NO_TEMPLATE_TEMPLATES
86 #  define BOOST_NO_SFINAE
87 #  define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
88 #  define BOOST_NO_IS_ABSTRACT
89 #  define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
90 // TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)?
91 #  if (_MSC_VER >= 1300)
92 #     define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
93 #  endif
94 
95 #endif
96 
97 #if _MSC_VER < 1400
98 // although a conforming signature for swprint exists in VC7.1
99 // it appears not to actually work:
100 #  define BOOST_NO_SWPRINTF
101 // Our extern template tests also fail for this compiler:
102 #  define BOOST_NO_CXX11_EXTERN_TEMPLATE
103 // Variadic macros do not exist for VC7.1 and lower
104 #  define BOOST_NO_CXX11_VARIADIC_MACROS
105 #endif
106 
107 #if defined(UNDER_CE)
108 // Windows CE does not have a conforming signature for swprintf
109 #  define BOOST_NO_SWPRINTF
110 #endif
111 
112 #if _MSC_VER < 1500  // 140X == VC++ 8.0
113 #  define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
114 #endif
115 
116 #if _MSC_VER < 1600  // 150X == VC++ 9.0
117    // A bug in VC9:
118 #  define BOOST_NO_ADL_BARRIER
119 #endif
120 
121 
122 // MSVC (including the latest checked version) has not yet completely
123 // implemented value-initialization, as is reported:
124 // "VC++ does not value-initialize members of derived classes without
125 // user-declared constructor", reported in 2009 by Sylvester Hesp:
126 // https://connect.microsoft.com/VisualStudio/feedback/details/484295
127 // "Presence of copy constructor breaks member class initialization",
128 // reported in 2009 by Alex Vakulenko:
129 // https://connect.microsoft.com/VisualStudio/feedback/details/499606
130 // "Value-initialization in new-expression", reported in 2005 by
131 // Pavel Kuznetsov (MetaCommunications Engineering):
132 // https://connect.microsoft.com/VisualStudio/feedback/details/100744
133 // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
134 // (Niels Dekker, LKEB, May 2010)
135 #  define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
136 
137 #if _MSC_VER < 1600  || !defined(BOOST_STRICT_CONFIG) // 150X == VC++ 9.0
138 #  define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
139 #endif
140 
141 #ifndef _NATIVE_WCHAR_T_DEFINED
142 #  define BOOST_NO_INTRINSIC_WCHAR_T
143 #endif
144 
145 #if defined(_WIN32_WCE) || defined(UNDER_CE)
146 #  define BOOST_NO_SWPRINTF
147 #endif
148 
149 // we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE
150 #if !defined(_WIN32_WCE) && !defined(UNDER_CE)
151 #  define BOOST_HAS_THREADEX
152 #  define BOOST_HAS_GETSYSTEMTIMEASFILETIME
153 #endif
154 
155 //
156 // check for exception handling support:
157 #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
158 #  define BOOST_NO_EXCEPTIONS
159 #endif
160 
161 //
162 // __int64 support:
163 //
164 #if (_MSC_VER >= 1200)
165 #   define BOOST_HAS_MS_INT64
166 #endif
167 #if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400))
168 #   define BOOST_HAS_LONG_LONG
169 #else
170 #   define BOOST_NO_LONG_LONG
171 #endif
172 #if (_MSC_VER >= 1400) && !defined(_DEBUG)
173 #   define BOOST_HAS_NRVO
174 #endif
175 //
176 // disable Win32 API's if compiler extentions are
177 // turned off:
178 //
179 #if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
180 #  define BOOST_DISABLE_WIN32
181 #endif
182 #if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
183 #  define BOOST_NO_RTTI
184 #endif
185 
186 //
187 // C++0x features
188 //
189 //   See above for BOOST_NO_LONG_LONG
190 
191 // C++ features supported by VC++ 10 (aka 2010)
192 //
193 #if _MSC_VER < 1600
194 #  define BOOST_NO_CXX11_AUTO_DECLARATIONS
195 #  define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
196 #  define BOOST_NO_CXX11_LAMBDAS
197 #  define BOOST_NO_CXX11_RVALUE_REFERENCES
198 #  define BOOST_NO_CXX11_STATIC_ASSERT
199 #  define BOOST_NO_CXX11_NULLPTR
200 #  define BOOST_NO_CXX11_DECLTYPE
201 #endif // _MSC_VER < 1600
202 
203 #if _MSC_VER >= 1600
204 #  define BOOST_HAS_STDINT_H
205 #endif
206 
207 // C++ features supported by VC++ 11 (aka 2012)
208 //
209 #if _MSC_VER < 1700
210 #  define BOOST_NO_CXX11_RANGE_BASED_FOR
211 #  define BOOST_NO_CXX11_SCOPED_ENUMS
212 #endif // _MSC_VER < 1700
213 
214 // C++0x features not supported by any versions
215 #define BOOST_NO_CXX11_CHAR16_T
216 #define BOOST_NO_CXX11_CHAR32_T
217 #define BOOST_NO_CXX11_CONSTEXPR
218 #define BOOST_NO_CXX11_DECLTYPE_N3276
219 #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
220 #define BOOST_NO_CXX11_DELETED_FUNCTIONS
221 #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
222 #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
223 #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
224 #define BOOST_NO_CXX11_NOEXCEPT
225 #define BOOST_NO_CXX11_RAW_LITERALS
226 #define BOOST_NO_CXX11_TEMPLATE_ALIASES
227 #define BOOST_NO_CXX11_UNICODE_LITERALS
228 #define BOOST_NO_CXX11_VARIADIC_TEMPLATES
229 #define BOOST_NO_SFINAE_EXPR
230 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
231 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
232 //
233 // prefix and suffix headers:
234 //
235 #ifndef BOOST_ABI_PREFIX
236 #  define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
237 #endif
238 #ifndef BOOST_ABI_SUFFIX
239 #  define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
240 #endif
241 
242 #ifndef BOOST_COMPILER
243 // TODO:
244 // these things are mostly bogus. 1200 means version 12.0 of the compiler. The
245 // artificial versions assigned to them only refer to the versions of some IDE
246 // these compilers have been shipped with, and even that is not all of it. Some
247 // were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
248 // IOW, you can't use these 'versions' in any sensible way. Sorry.
249 # if defined(UNDER_CE)
250 #   if _MSC_VER < 1200
251       // Note: these are so far off, they are not really supported
252 #   elif _MSC_VER < 1300 // eVC++ 4 comes with 1200-1202
253 #     define BOOST_COMPILER_VERSION evc4.0
254 #   elif _MSC_VER < 1400
255       // Note: I'm not aware of any CE compiler with version 13xx
256 #      if defined(BOOST_ASSERT_CONFIG)
257 #         error "Unknown EVC++ compiler version - please run the configure tests and report the results"
258 #      else
259 #         pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
260 #      endif
261 #   elif _MSC_VER < 1500
262 #     define BOOST_COMPILER_VERSION evc8
263 #   elif _MSC_VER < 1600
264 #     define BOOST_COMPILER_VERSION evc9
265 #   elif _MSC_VER < 1700
266 #     define BOOST_COMPILER_VERSION evc10
267 #   elif _MSC_VER < 1800
268 #     define BOOST_COMPILER_VERSION evc11
269 #   else
270 #      if defined(BOOST_ASSERT_CONFIG)
271 #         error "Unknown EVC++ compiler version - please run the configure tests and report the results"
272 #      else
273 #         pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
274 #      endif
275 #   endif
276 # else
277 #   if _MSC_VER < 1200
278       // Note: these are so far off, they are not really supported
279 #     define BOOST_COMPILER_VERSION 5.0
280 #   elif _MSC_VER < 1300
281 #       define BOOST_COMPILER_VERSION 6.0
282 #   elif _MSC_VER < 1310
283 #     define BOOST_COMPILER_VERSION 7.0
284 #   elif _MSC_VER < 1400
285 #     define BOOST_COMPILER_VERSION 7.1
286 #   elif _MSC_VER < 1500
287 #     define BOOST_COMPILER_VERSION 8.0
288 #   elif _MSC_VER < 1600
289 #     define BOOST_COMPILER_VERSION 9.0
290 #   elif _MSC_VER < 1700
291 #     define BOOST_COMPILER_VERSION 10.0
292 #   elif _MSC_VER < 1800
293 #     define BOOST_COMPILER_VERSION 11.0
294 #   else
295 #     define BOOST_COMPILER_VERSION _MSC_VER
296 #   endif
297 # endif
298 
299 #  define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
300 #endif
301 
302 //
303 // last known and checked version is 1700 (VC11, aka 2011):
304 #if (_MSC_VER > 1700)
305 #  if defined(BOOST_ASSERT_CONFIG)
306 #     error "Unknown compiler version - please run the configure tests and report the results"
307 #  else
308 #     pragma message("Unknown compiler version - please run the configure tests and report the results")
309 #  endif
310 #endif
311