blob: ded7284a628f68ff2674abcd4986749bf69b455f [file] [log] [blame]
Brian Silverman9d8fa392018-08-04 17:09:24 -07001// (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#define BOOST_HAS_PRAGMA_ONCE
38
39//
40// versions check:
41// we don't support Visual C++ prior to version 7.1:
42#if _MSC_VER < 1310
43# error "Compiler not supported or configured - please reconfigure"
44#endif
45
46#if _MSC_FULL_VER < 180020827
47# define BOOST_NO_FENV_H
48#endif
49
50#if _MSC_VER < 1400
51// although a conforming signature for swprint exists in VC7.1
52// it appears not to actually work:
53# define BOOST_NO_SWPRINTF
54// Our extern template tests also fail for this compiler:
55# define BOOST_NO_CXX11_EXTERN_TEMPLATE
56// Variadic macros do not exist for VC7.1 and lower
57# define BOOST_NO_CXX11_VARIADIC_MACROS
58# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
59#endif
60
61#if _MSC_VER < 1500 // 140X == VC++ 8.0
62# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
63#endif
64
65#if _MSC_VER < 1600 // 150X == VC++ 9.0
66 // A bug in VC9:
67# define BOOST_NO_ADL_BARRIER
68#endif
69
70
71#ifndef _NATIVE_WCHAR_T_DEFINED
72# define BOOST_NO_INTRINSIC_WCHAR_T
73#endif
74
75//
76// check for exception handling support:
77#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
78# define BOOST_NO_EXCEPTIONS
79#endif
80
81//
82// __int64 support:
83//
84#define BOOST_HAS_MS_INT64
85#if defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)
86# define BOOST_HAS_LONG_LONG
87#else
88# define BOOST_NO_LONG_LONG
89#endif
90#if (_MSC_VER >= 1400) && !defined(_DEBUG)
91# define BOOST_HAS_NRVO
92#endif
93#if _MSC_VER >= 1600 // 160X == VC++ 10.0
94# define BOOST_HAS_PRAGMA_DETECT_MISMATCH
95#endif
96//
97// disable Win32 API's if compiler extensions are
98// turned off:
99//
100#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
101# define BOOST_DISABLE_WIN32
102#endif
103#if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
104# define BOOST_NO_RTTI
105#endif
106
107//
108// TR1 features:
109//
110#if (_MSC_VER >= 1700) && defined(_HAS_CXX17) && (_HAS_CXX17 > 0)
111// # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
112// # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
113# define BOOST_HAS_TR1_UNORDERED_MAP
114# define BOOST_HAS_TR1_UNORDERED_SET
115#endif
116
117//
118// C++0x features
119//
120// See above for BOOST_NO_LONG_LONG
121
122// C++ features supported by VC++ 10 (aka 2010)
123//
124#if _MSC_VER < 1600
125# define BOOST_NO_CXX11_AUTO_DECLARATIONS
126# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
127# define BOOST_NO_CXX11_LAMBDAS
128# define BOOST_NO_CXX11_RVALUE_REFERENCES
129# define BOOST_NO_CXX11_STATIC_ASSERT
130# define BOOST_NO_CXX11_NULLPTR
131# define BOOST_NO_CXX11_DECLTYPE
132#endif // _MSC_VER < 1600
133
134#if _MSC_VER >= 1600
135# define BOOST_HAS_STDINT_H
136#endif
137
138// C++11 features supported by VC++ 11 (aka 2012)
139//
140#if _MSC_VER < 1700
141# define BOOST_NO_CXX11_FINAL
142# define BOOST_NO_CXX11_RANGE_BASED_FOR
143# define BOOST_NO_CXX11_SCOPED_ENUMS
144#endif // _MSC_VER < 1700
145
146// C++11 features supported by VC++ 12 (aka 2013).
147//
148#if _MSC_FULL_VER < 180020827
149# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
150# define BOOST_NO_CXX11_DELETED_FUNCTIONS
151# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
152# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
153# define BOOST_NO_CXX11_RAW_LITERALS
154# define BOOST_NO_CXX11_TEMPLATE_ALIASES
155# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
156# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
157# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
158# define BOOST_NO_CXX11_DECLTYPE_N3276
159#endif
160
161#if _MSC_FULL_VER >= 180020827
162#define BOOST_HAS_EXPM1
163#define BOOST_HAS_LOG1P
164#endif
165
166// C++11 features supported by VC++ 14 (aka 2015)
167//
168#if (_MSC_FULL_VER < 190023026)
169# define BOOST_NO_CXX11_NOEXCEPT
170# define BOOST_NO_CXX11_DEFAULTED_MOVES
171# define BOOST_NO_CXX11_REF_QUALIFIERS
172# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
173# define BOOST_NO_CXX11_ALIGNAS
174# define BOOST_NO_CXX11_INLINE_NAMESPACES
175# define BOOST_NO_CXX11_CHAR16_T
176# define BOOST_NO_CXX11_CHAR32_T
177# define BOOST_NO_CXX11_UNICODE_LITERALS
178# define BOOST_NO_CXX14_DECLTYPE_AUTO
179# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
180# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
181# define BOOST_NO_CXX14_BINARY_LITERALS
182# define BOOST_NO_CXX14_GENERIC_LAMBDAS
183# define BOOST_NO_CXX14_DIGIT_SEPARATORS
184# define BOOST_NO_CXX11_THREAD_LOCAL
185#endif
186// C++11 features supported by VC++ 14 update 3 (aka 2015)
187//
188#if (_MSC_FULL_VER < 190024210)
189# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
190# define BOOST_NO_SFINAE_EXPR
191# define BOOST_NO_CXX11_CONSTEXPR
192#endif
193
194// C++14 features supported by VC++ 14.1 (Visual Studio 2017)
195//
196#if (_MSC_VER < 1910)
197# define BOOST_NO_CXX14_AGGREGATE_NSDMI
198#endif
199
200// C++17 features supported by VC++ 14.1 (Visual Studio 2017) Update 3
201//
202#if (_MSC_VER < 1911) || (_MSVC_LANG < 201703)
203# define BOOST_NO_CXX17_STRUCTURED_BINDINGS
204# define BOOST_NO_CXX17_IF_CONSTEXPR
205#endif
206
207// MSVC including version 14 has not yet completely
208// implemented value-initialization, as is reported:
209// "VC++ does not value-initialize members of derived classes without
210// user-declared constructor", reported in 2009 by Sylvester Hesp:
211// https://connect.microsoft.com/VisualStudio/feedback/details/484295
212// "Presence of copy constructor breaks member class initialization",
213// reported in 2009 by Alex Vakulenko:
214// https://connect.microsoft.com/VisualStudio/feedback/details/499606
215// "Value-initialization in new-expression", reported in 2005 by
216// Pavel Kuznetsov (MetaCommunications Engineering):
217// https://connect.microsoft.com/VisualStudio/feedback/details/100744
218// Reported again by John Maddock in 2015 for VC14:
219// https://connect.microsoft.com/VisualStudio/feedback/details/1582233/c-subobjects-still-not-value-initialized-correctly
220// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
221// (Niels Dekker, LKEB, May 2010)
222// Still present in VC15.5, Dec 2017.
223#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
224//
225// C++ 11:
226//
227// This is supported with /permissive- for 15.5 onwards, unfortunately we appear to have no way to tell
228// if this is in effect or not, in any case nothing in Boost is currently using this, so we'll just go
229// on defining it for now:
230//
231# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
232
233#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402)
234// Supported from msvc-15.5 onwards:
235#define BOOST_NO_CXX11_SFINAE_EXPR
236#endif
237// C++ 14:
238// Still gives internal compiler error for msvc-15.5:
239# define BOOST_NO_CXX14_CONSTEXPR
240// C++ 17:
241#if (_MSC_VER < 1912) || (_MSVC_LANG < 201703)
242#define BOOST_NO_CXX17_INLINE_VARIABLES
243#define BOOST_NO_CXX17_FOLD_EXPRESSIONS
244#endif
245
246//
247// Things that don't work in clr mode:
248//
249#ifdef _M_CEE
250#ifndef BOOST_NO_CXX11_THREAD_LOCAL
251# define BOOST_NO_CXX11_THREAD_LOCAL
252#endif
253#ifndef BOOST_NO_SFINAE_EXPR
254# define BOOST_NO_SFINAE_EXPR
255#endif
256#ifndef BOOST_NO_CXX11_REF_QUALIFIERS
257# define BOOST_NO_CXX11_REF_QUALIFIERS
258#endif
259#endif
260#ifdef _M_CEE_PURE
261#ifndef BOOST_NO_CXX11_CONSTEXPR
262# define BOOST_NO_CXX11_CONSTEXPR
263#endif
264#endif
265
266//
267// prefix and suffix headers:
268//
269#ifndef BOOST_ABI_PREFIX
270# define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
271#endif
272#ifndef BOOST_ABI_SUFFIX
273# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
274#endif
275
276#ifndef BOOST_COMPILER
277// TODO:
278// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
279// artificial versions assigned to them only refer to the versions of some IDE
280// these compilers have been shipped with, and even that is not all of it. Some
281// were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
282// IOW, you can't use these 'versions' in any sensible way. Sorry.
283# if defined(UNDER_CE)
284# if _MSC_VER < 1400
285 // Note: I'm not aware of any CE compiler with version 13xx
286# if defined(BOOST_ASSERT_CONFIG)
287# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
288# else
289# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
290# endif
291# elif _MSC_VER < 1500
292# define BOOST_COMPILER_VERSION evc8
293# elif _MSC_VER < 1600
294# define BOOST_COMPILER_VERSION evc9
295# elif _MSC_VER < 1700
296# define BOOST_COMPILER_VERSION evc10
297# elif _MSC_VER < 1800
298# define BOOST_COMPILER_VERSION evc11
299# elif _MSC_VER < 1900
300# define BOOST_COMPILER_VERSION evc12
301# elif _MSC_VER < 2000
302# define BOOST_COMPILER_VERSION evc14
303# else
304# if defined(BOOST_ASSERT_CONFIG)
305# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
306# else
307# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
308# endif
309# endif
310# else
311# if _MSC_VER < 1200
312 // Note: Versions up to 7.0 aren't supported.
313# define BOOST_COMPILER_VERSION 5.0
314# elif _MSC_VER < 1300
315# define BOOST_COMPILER_VERSION 6.0
316# elif _MSC_VER < 1310
317# define BOOST_COMPILER_VERSION 7.0
318# elif _MSC_VER < 1400
319# define BOOST_COMPILER_VERSION 7.1
320# elif _MSC_VER < 1500
321# define BOOST_COMPILER_VERSION 8.0
322# elif _MSC_VER < 1600
323# define BOOST_COMPILER_VERSION 9.0
324# elif _MSC_VER < 1700
325# define BOOST_COMPILER_VERSION 10.0
326# elif _MSC_VER < 1800
327# define BOOST_COMPILER_VERSION 11.0
328# elif _MSC_VER < 1900
329# define BOOST_COMPILER_VERSION 12.0
330# elif _MSC_VER < 1910
331# define BOOST_COMPILER_VERSION 14.0
332# elif _MSC_VER < 1920
333# define BOOST_COMPILER_VERSION 14.1
334# else
335# define BOOST_COMPILER_VERSION _MSC_VER
336# endif
337# endif
338
339# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
340#endif
341
342#include <boost/config/pragma_message.hpp>
343
344//
345// last known and checked version is 19.12.25830.2 (VC++ 2017.3):
346#if (_MSC_VER > 1912)
347# if defined(BOOST_ASSERT_CONFIG)
348# error "Boost.Config is older than your current compiler version."
349# elif !defined(BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE)
350 //
351 // Disabled as of March 2018 - the pace of VS releases is hard to keep up with
352 // and in any case, we have relatively few defect macros defined now.
353 // BOOST_PRAGMA_MESSAGE("Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an updated Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.")
354# endif
355#endif