comparison DEPENDENCIES/generic/include/boost/config/compiler/gcc.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
14 // GNU C++ compiler setup. 14 // GNU C++ compiler setup.
15 15
16 // 16 //
17 // Define BOOST_GCC so we know this is "real" GCC and not some pretender: 17 // Define BOOST_GCC so we know this is "real" GCC and not some pretender:
18 // 18 //
19 #define BOOST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
19 #if !defined(__CUDACC__) 20 #if !defined(__CUDACC__)
20 #define BOOST_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 21 #define BOOST_GCC BOOST_GCC_VERSION
22 #endif
23
24 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
25 # define BOOST_GCC_CXX11
21 #endif 26 #endif
22 27
23 #if __GNUC__ == 3 28 #if __GNUC__ == 3
24 # if defined (__PATHSCALE__) 29 # if defined (__PATHSCALE__)
25 # define BOOST_NO_TWO_PHASE_NAME_LOOKUP 30 # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
40 # define BOOST_NO_IS_ABSTRACT 45 # define BOOST_NO_IS_ABSTRACT
41 # endif 46 # endif
42 #endif 47 #endif
43 48
44 // GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links 49 // GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links
45 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 50 #if BOOST_GCC_VERSION >= 30400
46 #define BOOST_HAS_PRAGMA_ONCE 51 #define BOOST_HAS_PRAGMA_ONCE
47 #endif 52 #endif
48 53
49 #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 ) 54 #if BOOST_GCC_VERSION < 40400
50 // Previous versions of GCC did not completely implement value-initialization: 55 // Previous versions of GCC did not completely implement value-initialization:
51 // GCC Bug 30111, "Value-initialization of POD base class doesn't initialize 56 // GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
52 // members", reported by Jonathan Wakely in 2006, 57 // members", reported by Jonathan Wakely in 2006,
53 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4) 58 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
54 // GCC Bug 33916, "Default constructor fails to initialize array members", 59 // GCC Bug 33916, "Default constructor fails to initialize array members",
72 # define BOOST_HAS_THREADS 77 # define BOOST_HAS_THREADS
73 #endif 78 #endif
74 79
75 // 80 //
76 // gcc has "long long" 81 // gcc has "long long"
77 // 82 // Except on Darwin with standard compliance enabled (-pedantic)
78 #define BOOST_HAS_LONG_LONG 83 // Apple gcc helpfully defines this macro we can query
84 //
85 #if !defined(__DARWIN_NO_LONG_LONG)
86 # define BOOST_HAS_LONG_LONG
87 #endif
79 88
80 // 89 //
81 // gcc implements the named return value optimization since version 3.1 90 // gcc implements the named return value optimization since version 3.1
82 // 91 //
83 #define BOOST_HAS_NRVO 92 #define BOOST_HAS_NRVO
108 #endif 117 #endif
109 118
110 // 119 //
111 // RTTI and typeinfo detection is possible post gcc-4.3: 120 // RTTI and typeinfo detection is possible post gcc-4.3:
112 // 121 //
113 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403 122 #if BOOST_GCC_VERSION > 40300
114 # ifndef __GXX_RTTI 123 # ifndef __GXX_RTTI
115 # ifndef BOOST_NO_TYPEID 124 # ifndef BOOST_NO_TYPEID
116 # define BOOST_NO_TYPEID 125 # define BOOST_NO_TYPEID
117 # endif 126 # endif
118 # ifndef BOOST_NO_RTTI 127 # ifndef BOOST_NO_RTTI
135 # define BOOST_HAS_INT128 144 # define BOOST_HAS_INT128
136 #endif 145 #endif
137 146
138 // C++0x features in 4.3.n and later 147 // C++0x features in 4.3.n and later
139 // 148 //
140 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__) 149 #if (BOOST_GCC_VERSION >= 40300) && defined(BOOST_GCC_CXX11)
141 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are 150 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
142 // passed on the command line, which in turn defines 151 // passed on the command line, which in turn defines
143 // __GXX_EXPERIMENTAL_CXX0X__. 152 // __GXX_EXPERIMENTAL_CXX0X__.
144 # define BOOST_HAS_DECLTYPE 153 # define BOOST_HAS_DECLTYPE
145 # define BOOST_HAS_RVALUE_REFS 154 # define BOOST_HAS_RVALUE_REFS
148 #else 157 #else
149 # define BOOST_NO_CXX11_DECLTYPE 158 # define BOOST_NO_CXX11_DECLTYPE
150 # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS 159 # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
151 # define BOOST_NO_CXX11_RVALUE_REFERENCES 160 # define BOOST_NO_CXX11_RVALUE_REFERENCES
152 # define BOOST_NO_CXX11_STATIC_ASSERT 161 # define BOOST_NO_CXX11_STATIC_ASSERT
153
154 // Variadic templates compiler:
155 // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
156 # if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
157 # define BOOST_HAS_VARIADIC_TMPL
158 # else
159 # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
160 # endif
161 #endif 162 #endif
162 163
163 // C++0x features in 4.4.n and later 164 // C++0x features in 4.4.n and later
164 // 165 //
165 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 166 #if (BOOST_GCC_VERSION < 40400) || !defined(BOOST_GCC_CXX11)
166 # define BOOST_NO_CXX11_AUTO_DECLARATIONS 167 # define BOOST_NO_CXX11_AUTO_DECLARATIONS
167 # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS 168 # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
168 # define BOOST_NO_CXX11_CHAR16_T 169 # define BOOST_NO_CXX11_CHAR16_T
169 # define BOOST_NO_CXX11_CHAR32_T 170 # define BOOST_NO_CXX11_CHAR32_T
170 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST 171 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
171 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS 172 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
172 # define BOOST_NO_CXX11_DELETED_FUNCTIONS 173 # define BOOST_NO_CXX11_DELETED_FUNCTIONS
173 # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES 174 # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
174 # define BOOST_NO_CXX11_INLINE_NAMESPACES 175 # define BOOST_NO_CXX11_INLINE_NAMESPACES
175 #endif 176 # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
176 177 #endif
177 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) 178
179 #if BOOST_GCC_VERSION < 40500
178 # define BOOST_NO_SFINAE_EXPR 180 # define BOOST_NO_SFINAE_EXPR
179 #endif 181 #endif
180 182
181 // GCC 4.5 forbids declaration of defaulted functions in private or protected sections 183 // GCC 4.5 forbids declaration of defaulted functions in private or protected sections
182 #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) 184 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 5) || !defined(BOOST_GCC_CXX11)
183 # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS 185 # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
184 #endif 186 #endif
185 187
186 // C++0x features in 4.5.0 and later 188 // C++0x features in 4.5.0 and later
187 // 189 //
188 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 190 #if (BOOST_GCC_VERSION < 40500) || !defined(BOOST_GCC_CXX11)
189 # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS 191 # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
190 # define BOOST_NO_CXX11_LAMBDAS 192 # define BOOST_NO_CXX11_LAMBDAS
191 # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS 193 # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
192 # define BOOST_NO_CXX11_RAW_LITERALS 194 # define BOOST_NO_CXX11_RAW_LITERALS
193 # define BOOST_NO_CXX11_UNICODE_LITERALS 195 # define BOOST_NO_CXX11_UNICODE_LITERALS
194 #endif 196 #endif
195 197
196 // C++0x features in 4.5.1 and later 198 // C++0x features in 4.5.1 and later
197 // 199 //
198 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 200 #if (BOOST_GCC_VERSION < 40501) || !defined(BOOST_GCC_CXX11)
199 // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1 201 // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
200 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 202 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
201 # define BOOST_NO_CXX11_SCOPED_ENUMS 203 # define BOOST_NO_CXX11_SCOPED_ENUMS
202 #endif 204 #endif
203 205
204 // C++0x features in 4.6.n and later 206 // C++0x features in 4.6.n and later
205 // 207 //
206 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 208 #if (BOOST_GCC_VERSION < 40600) || !defined(BOOST_GCC_CXX11)
207 #define BOOST_NO_CXX11_CONSTEXPR 209 #define BOOST_NO_CXX11_CONSTEXPR
208 #define BOOST_NO_CXX11_NOEXCEPT 210 #define BOOST_NO_CXX11_NOEXCEPT
209 #define BOOST_NO_CXX11_NULLPTR 211 #define BOOST_NO_CXX11_NULLPTR
210 #define BOOST_NO_CXX11_RANGE_BASED_FOR 212 #define BOOST_NO_CXX11_RANGE_BASED_FOR
211 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX 213 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
212 #endif 214 #endif
213 215
214 // C++0x features in 4.7.n and later 216 // C++0x features in 4.7.n and later
215 // 217 //
216 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 218 #if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11)
219 # define BOOST_NO_CXX11_FINAL
217 # define BOOST_NO_CXX11_TEMPLATE_ALIASES 220 # define BOOST_NO_CXX11_TEMPLATE_ALIASES
218 # define BOOST_NO_CXX11_USER_DEFINED_LITERALS 221 # define BOOST_NO_CXX11_USER_DEFINED_LITERALS
222 # define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
219 #endif 223 #endif
220 224
221 // C++0x features in 4.8.n and later 225 // C++0x features in 4.8.n and later
222 // 226 //
223 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 227 #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11)
224 # define BOOST_NO_CXX11_ALIGNAS 228 # define BOOST_NO_CXX11_ALIGNAS
225 #endif 229 #endif
226 230
227 // C++0x features in 4.8.1 and later 231 // C++0x features in 4.8.1 and later
228 // 232 //
229 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__) 233 #if (BOOST_GCC_VERSION < 40801) || !defined(BOOST_GCC_CXX11)
230 # define BOOST_NO_CXX11_DECLTYPE_N3276 234 # define BOOST_NO_CXX11_DECLTYPE_N3276
235 # define BOOST_NO_CXX11_REF_QUALIFIERS
236 # define BOOST_NO_CXX14_BINARY_LITERALS
237 #endif
238
239 // C++14 features in 4.9.0 and later
240 //
241 #if (BOOST_GCC_VERSION < 40900) || (__cplusplus < 201300)
242 # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
243 # define BOOST_NO_CXX14_GENERIC_LAMBDAS
244 # define BOOST_NO_CXX14_DIGIT_SEPARATORS
245 # define BOOST_NO_CXX14_DECLTYPE_AUTO
246 # if !((BOOST_GCC_VERSION >= 40801) && (BOOST_GCC_VERSION < 40900) && defined(BOOST_GCC_CXX11))
247 # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
248 # endif
249 #endif
250
251
252 // C++ 14:
253 #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)
254 # define BOOST_NO_CXX14_AGGREGATE_NSDMI
255 #endif
256 #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304)
257 # define BOOST_NO_CXX14_CONSTEXPR
258 #endif
259 #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304)
260 # define BOOST_NO_CXX14_VARIABLE_TEMPLATES
261 #endif
262
263 //
264 // Unused attribute:
265 #if __GNUC__ >= 4
266 # define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
231 #endif 267 #endif
232 268
233 #ifndef BOOST_COMPILER 269 #ifndef BOOST_COMPILER
234 # define BOOST_COMPILER "GNU C++ version " __VERSION__ 270 # define BOOST_COMPILER "GNU C++ version " __VERSION__
235 #endif 271 #endif
241 # define BOOST_COMPILER "ConceptGCC version " __VERSION__ 277 # define BOOST_COMPILER "ConceptGCC version " __VERSION__
242 #endif 278 #endif
243 279
244 // versions check: 280 // versions check:
245 // we don't know gcc prior to version 3.30: 281 // we don't know gcc prior to version 3.30:
246 #if (__GNUC__ < 3) || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3)) 282 #if (BOOST_GCC_VERSION< 30300)
247 # error "Compiler not configured - please reconfigure" 283 # error "Compiler not configured - please reconfigure"
248 #endif 284 #endif
249 // 285 //
250 // last known and checked version is 4.6 (Pre-release): 286 // last known and checked version is 4.9:
251 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) 287 #if (BOOST_GCC_VERSION > 40900)
252 # if defined(BOOST_ASSERT_CONFIG) 288 # if defined(BOOST_ASSERT_CONFIG)
253 # error "Unknown compiler version - please run the configure tests and report the results" 289 # error "Unknown compiler version - please run the configure tests and report the results"
254 # else 290 # else
255 // we don't emit warnings here anymore since there are no defect macros defined for 291 // we don't emit warnings here anymore since there are no defect macros defined for
256 // gcc post 3.4, so any failures are gcc regressions... 292 // gcc post 3.4, so any failures are gcc regressions...
257 //# warning "Unknown compiler version - please run the configure tests and report the results" 293 //# warning "Unknown compiler version - please run the configure tests and report the results"
258 # endif 294 # endif
259 #endif 295 #endif
260 296
261