Chris@16
|
1 // (C) Copyright John Maddock 2001 - 2003.
|
Chris@16
|
2 // (C) Copyright Darin Adler 2001 - 2002.
|
Chris@16
|
3 // (C) Copyright Jens Maurer 2001 - 2002.
|
Chris@16
|
4 // (C) Copyright Beman Dawes 2001 - 2003.
|
Chris@16
|
5 // (C) Copyright Douglas Gregor 2002.
|
Chris@16
|
6 // (C) Copyright David Abrahams 2002 - 2003.
|
Chris@16
|
7 // (C) Copyright Synge Todo 2003.
|
Chris@16
|
8 // Use, modification and distribution are subject to the
|
Chris@16
|
9 // Boost Software License, Version 1.0. (See accompanying file
|
Chris@16
|
10 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
11
|
Chris@16
|
12 // See http://www.boost.org for most recent version.
|
Chris@16
|
13
|
Chris@16
|
14 // GNU C++ compiler setup.
|
Chris@16
|
15
|
Chris@16
|
16 //
|
Chris@16
|
17 // Define BOOST_GCC so we know this is "real" GCC and not some pretender:
|
Chris@16
|
18 //
|
Chris@101
|
19 #define BOOST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
Chris@16
|
20 #if !defined(__CUDACC__)
|
Chris@101
|
21 #define BOOST_GCC BOOST_GCC_VERSION
|
Chris@101
|
22 #endif
|
Chris@101
|
23
|
Chris@101
|
24 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
|
Chris@101
|
25 # define BOOST_GCC_CXX11
|
Chris@16
|
26 #endif
|
Chris@16
|
27
|
Chris@16
|
28 #if __GNUC__ == 3
|
Chris@16
|
29 # if defined (__PATHSCALE__)
|
Chris@16
|
30 # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
Chris@16
|
31 # define BOOST_NO_IS_ABSTRACT
|
Chris@16
|
32 # endif
|
Chris@16
|
33
|
Chris@16
|
34 # if __GNUC_MINOR__ < 4
|
Chris@16
|
35 # define BOOST_NO_IS_ABSTRACT
|
Chris@16
|
36 # endif
|
Chris@16
|
37 # define BOOST_NO_CXX11_EXTERN_TEMPLATE
|
Chris@16
|
38 #endif
|
Chris@16
|
39 #if __GNUC__ < 4
|
Chris@16
|
40 //
|
Chris@16
|
41 // All problems to gcc-3.x and earlier here:
|
Chris@16
|
42 //
|
Chris@16
|
43 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
Chris@16
|
44 # ifdef __OPEN64__
|
Chris@16
|
45 # define BOOST_NO_IS_ABSTRACT
|
Chris@16
|
46 # endif
|
Chris@16
|
47 #endif
|
Chris@16
|
48
|
Chris@16
|
49 // GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links
|
Chris@101
|
50 #if BOOST_GCC_VERSION >= 30400
|
Chris@16
|
51 #define BOOST_HAS_PRAGMA_ONCE
|
Chris@16
|
52 #endif
|
Chris@16
|
53
|
Chris@101
|
54 #if BOOST_GCC_VERSION < 40400
|
Chris@16
|
55 // Previous versions of GCC did not completely implement value-initialization:
|
Chris@16
|
56 // GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
|
Chris@16
|
57 // members", reported by Jonathan Wakely in 2006,
|
Chris@16
|
58 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
|
Chris@16
|
59 // GCC Bug 33916, "Default constructor fails to initialize array members",
|
Chris@16
|
60 // reported by Michael Elizabeth Chastain in 2007,
|
Chris@16
|
61 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
|
Chris@16
|
62 // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
|
Chris@16
|
63 #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
Chris@16
|
64 #endif
|
Chris@16
|
65
|
Chris@16
|
66 #if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
|
Chris@16
|
67 # define BOOST_NO_EXCEPTIONS
|
Chris@16
|
68 #endif
|
Chris@16
|
69
|
Chris@16
|
70
|
Chris@16
|
71 //
|
Chris@16
|
72 // Threading support: Turn this on unconditionally here (except for
|
Chris@16
|
73 // those platforms where we can know for sure). It will get turned off again
|
Chris@16
|
74 // later if no threading API is detected.
|
Chris@16
|
75 //
|
Chris@16
|
76 #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
|
Chris@16
|
77 # define BOOST_HAS_THREADS
|
Chris@16
|
78 #endif
|
Chris@16
|
79
|
Chris@16
|
80 //
|
Chris@16
|
81 // gcc has "long long"
|
Chris@101
|
82 // Except on Darwin with standard compliance enabled (-pedantic)
|
Chris@101
|
83 // Apple gcc helpfully defines this macro we can query
|
Chris@16
|
84 //
|
Chris@101
|
85 #if !defined(__DARWIN_NO_LONG_LONG)
|
Chris@101
|
86 # define BOOST_HAS_LONG_LONG
|
Chris@101
|
87 #endif
|
Chris@16
|
88
|
Chris@16
|
89 //
|
Chris@16
|
90 // gcc implements the named return value optimization since version 3.1
|
Chris@16
|
91 //
|
Chris@16
|
92 #define BOOST_HAS_NRVO
|
Chris@16
|
93
|
Chris@16
|
94 // Branch prediction hints
|
Chris@16
|
95 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
|
Chris@16
|
96 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
|
Chris@16
|
97
|
Chris@16
|
98 //
|
Chris@16
|
99 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
|
Chris@16
|
100 //
|
Chris@16
|
101 #if __GNUC__ >= 4
|
Chris@16
|
102 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
|
Chris@16
|
103 // All Win32 development environments, including 64-bit Windows and MinGW, define
|
Chris@16
|
104 // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
|
Chris@16
|
105 // so does not define _WIN32 or its variants.
|
Chris@16
|
106 # define BOOST_HAS_DECLSPEC
|
Chris@16
|
107 # define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
|
Chris@16
|
108 # define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))
|
Chris@16
|
109 # else
|
Chris@16
|
110 # define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
|
Chris@16
|
111 # define BOOST_SYMBOL_IMPORT
|
Chris@16
|
112 # endif
|
Chris@16
|
113 # define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
|
Chris@16
|
114 #else
|
Chris@16
|
115 // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
|
Chris@16
|
116 # define BOOST_SYMBOL_EXPORT
|
Chris@16
|
117 #endif
|
Chris@16
|
118
|
Chris@16
|
119 //
|
Chris@16
|
120 // RTTI and typeinfo detection is possible post gcc-4.3:
|
Chris@16
|
121 //
|
Chris@101
|
122 #if BOOST_GCC_VERSION > 40300
|
Chris@16
|
123 # ifndef __GXX_RTTI
|
Chris@16
|
124 # ifndef BOOST_NO_TYPEID
|
Chris@16
|
125 # define BOOST_NO_TYPEID
|
Chris@16
|
126 # endif
|
Chris@16
|
127 # ifndef BOOST_NO_RTTI
|
Chris@16
|
128 # define BOOST_NO_RTTI
|
Chris@16
|
129 # endif
|
Chris@16
|
130 # endif
|
Chris@16
|
131 #endif
|
Chris@16
|
132
|
Chris@16
|
133 //
|
Chris@16
|
134 // Recent GCC versions have __int128 when in 64-bit mode.
|
Chris@16
|
135 //
|
Chris@16
|
136 // We disable this if the compiler is really nvcc as it
|
Chris@16
|
137 // doesn't actually support __int128 as of CUDA_VERSION=5000
|
Chris@16
|
138 // even though it defines __SIZEOF_INT128__.
|
Chris@16
|
139 // See https://svn.boost.org/trac/boost/ticket/8048
|
Chris@16
|
140 // Only re-enable this for nvcc if you're absolutely sure
|
Chris@16
|
141 // of the circumstances under which it's supported:
|
Chris@16
|
142 //
|
Chris@16
|
143 #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
|
Chris@16
|
144 # define BOOST_HAS_INT128
|
Chris@16
|
145 #endif
|
Chris@16
|
146
|
Chris@16
|
147 // C++0x features in 4.3.n and later
|
Chris@16
|
148 //
|
Chris@101
|
149 #if (BOOST_GCC_VERSION >= 40300) && defined(BOOST_GCC_CXX11)
|
Chris@16
|
150 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
|
Chris@16
|
151 // passed on the command line, which in turn defines
|
Chris@16
|
152 // __GXX_EXPERIMENTAL_CXX0X__.
|
Chris@16
|
153 # define BOOST_HAS_DECLTYPE
|
Chris@16
|
154 # define BOOST_HAS_RVALUE_REFS
|
Chris@16
|
155 # define BOOST_HAS_STATIC_ASSERT
|
Chris@16
|
156 # define BOOST_HAS_VARIADIC_TMPL
|
Chris@16
|
157 #else
|
Chris@16
|
158 # define BOOST_NO_CXX11_DECLTYPE
|
Chris@16
|
159 # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
Chris@16
|
160 # define BOOST_NO_CXX11_RVALUE_REFERENCES
|
Chris@16
|
161 # define BOOST_NO_CXX11_STATIC_ASSERT
|
Chris@16
|
162 #endif
|
Chris@16
|
163
|
Chris@16
|
164 // C++0x features in 4.4.n and later
|
Chris@16
|
165 //
|
Chris@101
|
166 #if (BOOST_GCC_VERSION < 40400) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
167 # define BOOST_NO_CXX11_AUTO_DECLARATIONS
|
Chris@16
|
168 # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
|
Chris@16
|
169 # define BOOST_NO_CXX11_CHAR16_T
|
Chris@16
|
170 # define BOOST_NO_CXX11_CHAR32_T
|
Chris@16
|
171 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
Chris@16
|
172 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
Chris@16
|
173 # define BOOST_NO_CXX11_DELETED_FUNCTIONS
|
Chris@16
|
174 # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
|
Chris@16
|
175 # define BOOST_NO_CXX11_INLINE_NAMESPACES
|
Chris@101
|
176 # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
Chris@16
|
177 #endif
|
Chris@16
|
178
|
Chris@101
|
179 #if BOOST_GCC_VERSION < 40500
|
Chris@16
|
180 # define BOOST_NO_SFINAE_EXPR
|
Chris@16
|
181 #endif
|
Chris@16
|
182
|
Chris@16
|
183 // GCC 4.5 forbids declaration of defaulted functions in private or protected sections
|
Chris@101
|
184 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 5) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
185 # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
|
Chris@16
|
186 #endif
|
Chris@16
|
187
|
Chris@16
|
188 // C++0x features in 4.5.0 and later
|
Chris@16
|
189 //
|
Chris@101
|
190 #if (BOOST_GCC_VERSION < 40500) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
191 # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
Chris@16
|
192 # define BOOST_NO_CXX11_LAMBDAS
|
Chris@16
|
193 # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
|
Chris@16
|
194 # define BOOST_NO_CXX11_RAW_LITERALS
|
Chris@16
|
195 # define BOOST_NO_CXX11_UNICODE_LITERALS
|
Chris@16
|
196 #endif
|
Chris@16
|
197
|
Chris@16
|
198 // C++0x features in 4.5.1 and later
|
Chris@16
|
199 //
|
Chris@101
|
200 #if (BOOST_GCC_VERSION < 40501) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
201 // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
|
Chris@16
|
202 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
|
Chris@16
|
203 # define BOOST_NO_CXX11_SCOPED_ENUMS
|
Chris@16
|
204 #endif
|
Chris@16
|
205
|
Chris@16
|
206 // C++0x features in 4.6.n and later
|
Chris@16
|
207 //
|
Chris@101
|
208 #if (BOOST_GCC_VERSION < 40600) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
209 #define BOOST_NO_CXX11_CONSTEXPR
|
Chris@16
|
210 #define BOOST_NO_CXX11_NOEXCEPT
|
Chris@16
|
211 #define BOOST_NO_CXX11_NULLPTR
|
Chris@16
|
212 #define BOOST_NO_CXX11_RANGE_BASED_FOR
|
Chris@16
|
213 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
Chris@16
|
214 #endif
|
Chris@16
|
215
|
Chris@16
|
216 // C++0x features in 4.7.n and later
|
Chris@16
|
217 //
|
Chris@101
|
218 #if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11)
|
Chris@101
|
219 # define BOOST_NO_CXX11_FINAL
|
Chris@16
|
220 # define BOOST_NO_CXX11_TEMPLATE_ALIASES
|
Chris@16
|
221 # define BOOST_NO_CXX11_USER_DEFINED_LITERALS
|
Chris@101
|
222 # define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
|
Chris@16
|
223 #endif
|
Chris@16
|
224
|
Chris@16
|
225 // C++0x features in 4.8.n and later
|
Chris@16
|
226 //
|
Chris@101
|
227 #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
228 # define BOOST_NO_CXX11_ALIGNAS
|
Chris@16
|
229 #endif
|
Chris@16
|
230
|
Chris@16
|
231 // C++0x features in 4.8.1 and later
|
Chris@16
|
232 //
|
Chris@101
|
233 #if (BOOST_GCC_VERSION < 40801) || !defined(BOOST_GCC_CXX11)
|
Chris@16
|
234 # define BOOST_NO_CXX11_DECLTYPE_N3276
|
Chris@101
|
235 # define BOOST_NO_CXX11_REF_QUALIFIERS
|
Chris@101
|
236 # define BOOST_NO_CXX14_BINARY_LITERALS
|
Chris@101
|
237 #endif
|
Chris@101
|
238
|
Chris@101
|
239 // C++14 features in 4.9.0 and later
|
Chris@101
|
240 //
|
Chris@101
|
241 #if (BOOST_GCC_VERSION < 40900) || (__cplusplus < 201300)
|
Chris@101
|
242 # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
|
Chris@101
|
243 # define BOOST_NO_CXX14_GENERIC_LAMBDAS
|
Chris@101
|
244 # define BOOST_NO_CXX14_DIGIT_SEPARATORS
|
Chris@101
|
245 # define BOOST_NO_CXX14_DECLTYPE_AUTO
|
Chris@101
|
246 # if !((BOOST_GCC_VERSION >= 40801) && (BOOST_GCC_VERSION < 40900) && defined(BOOST_GCC_CXX11))
|
Chris@101
|
247 # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
|
Chris@101
|
248 # endif
|
Chris@101
|
249 #endif
|
Chris@101
|
250
|
Chris@101
|
251
|
Chris@101
|
252 // C++ 14:
|
Chris@101
|
253 #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
|
Chris@101
|
254 # define BOOST_NO_CXX14_AGGREGATE_NSDMI
|
Chris@101
|
255 #endif
|
Chris@101
|
256 #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
|
Chris@101
|
257 # define BOOST_NO_CXX14_CONSTEXPR
|
Chris@101
|
258 #endif
|
Chris@101
|
259 #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
|
Chris@101
|
260 # define BOOST_NO_CXX14_VARIABLE_TEMPLATES
|
Chris@101
|
261 #endif
|
Chris@101
|
262
|
Chris@101
|
263 //
|
Chris@101
|
264 // Unused attribute:
|
Chris@101
|
265 #if __GNUC__ >= 4
|
Chris@101
|
266 # define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
|
Chris@16
|
267 #endif
|
Chris@16
|
268
|
Chris@16
|
269 #ifndef BOOST_COMPILER
|
Chris@16
|
270 # define BOOST_COMPILER "GNU C++ version " __VERSION__
|
Chris@16
|
271 #endif
|
Chris@16
|
272
|
Chris@16
|
273 // ConceptGCC compiler:
|
Chris@16
|
274 // http://www.generic-programming.org/software/ConceptGCC/
|
Chris@16
|
275 #ifdef __GXX_CONCEPTS__
|
Chris@16
|
276 # define BOOST_HAS_CONCEPTS
|
Chris@16
|
277 # define BOOST_COMPILER "ConceptGCC version " __VERSION__
|
Chris@16
|
278 #endif
|
Chris@16
|
279
|
Chris@16
|
280 // versions check:
|
Chris@16
|
281 // we don't know gcc prior to version 3.30:
|
Chris@101
|
282 #if (BOOST_GCC_VERSION< 30300)
|
Chris@16
|
283 # error "Compiler not configured - please reconfigure"
|
Chris@16
|
284 #endif
|
Chris@16
|
285 //
|
Chris@101
|
286 // last known and checked version is 4.9:
|
Chris@101
|
287 #if (BOOST_GCC_VERSION > 40900)
|
Chris@16
|
288 # if defined(BOOST_ASSERT_CONFIG)
|
Chris@16
|
289 # error "Unknown compiler version - please run the configure tests and report the results"
|
Chris@16
|
290 # else
|
Chris@16
|
291 // we don't emit warnings here anymore since there are no defect macros defined for
|
Chris@16
|
292 // gcc post 3.4, so any failures are gcc regressions...
|
Chris@16
|
293 //# warning "Unknown compiler version - please run the configure tests and report the results"
|
Chris@16
|
294 # endif
|
Chris@16
|
295 #endif
|
Chris@16
|
296
|