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