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