1 // (C) Copyright John Maddock 2001 - 2003.
2 // (C) Copyright Darin Adler 2001 - 2002.
3 // (C) Copyright Jens Maurer 2001 - 2002.
4 // (C) Copyright Beman Dawes 2001 - 2003.
5 // (C) Copyright Douglas Gregor 2002.
6 // (C) Copyright David Abrahams 2002 - 2003.
7 // (C) Copyright Synge Todo 2003.
8 // Use, modification and distribution are subject to the
9 // Boost Software License, Version 1.0. (See accompanying file
10 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 // See http://www.boost.org for most recent version.
14 // GNU C++ compiler setup.
17 // Define BOOST_GCC so we know this is "real" GCC and not some pretender:
19 #if !defined(__CUDACC__)
20 #define BOOST_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
24 # if defined (__PATHSCALE__)
25 # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
26 # define BOOST_NO_IS_ABSTRACT
29 # if __GNUC_MINOR__ < 4
30 # define BOOST_NO_IS_ABSTRACT
32 # define BOOST_NO_CXX11_EXTERN_TEMPLATE
36 // All problems to gcc-3.x and earlier here:
38 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
40 # define BOOST_NO_IS_ABSTRACT
44 // 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)
46 #define BOOST_HAS_PRAGMA_ONCE
49 #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
50 // Previous versions of GCC did not completely implement value-initialization:
51 // GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
52 // members", reported by Jonathan Wakely in 2006,
53 // 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",
55 // reported by Michael Elizabeth Chastain in 2007,
56 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
57 // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
58 #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
61 #if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
62 # define BOOST_NO_EXCEPTIONS
67 // Threading support: Turn this on unconditionally here (except for
68 // those platforms where we can know for sure). It will get turned off again
69 // later if no threading API is detected.
71 #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
72 # define BOOST_HAS_THREADS
76 // gcc has "long long"
78 #define BOOST_HAS_LONG_LONG
81 // gcc implements the named return value optimization since version 3.1
83 #define BOOST_HAS_NRVO
85 // Branch prediction hints
86 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
87 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
90 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
93 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
94 // All Win32 development environments, including 64-bit Windows and MinGW, define
95 // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
96 // so does not define _WIN32 or its variants.
97 # define BOOST_HAS_DECLSPEC
98 # define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
99 # define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))
101 # define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
102 # define BOOST_SYMBOL_IMPORT
104 # define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
106 // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
107 # define BOOST_SYMBOL_EXPORT
111 // RTTI and typeinfo detection is possible post gcc-4.3:
113 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
115 # ifndef BOOST_NO_TYPEID
116 # define BOOST_NO_TYPEID
118 # ifndef BOOST_NO_RTTI
119 # define BOOST_NO_RTTI
125 // Recent GCC versions have __int128 when in 64-bit mode.
127 // We disable this if the compiler is really nvcc as it
128 // doesn't actually support __int128 as of CUDA_VERSION=5000
129 // even though it defines __SIZEOF_INT128__.
130 // See https://svn.boost.org/trac/boost/ticket/8048
131 // Only re-enable this for nvcc if you're absolutely sure
132 // of the circumstances under which it's supported:
134 #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
135 # define BOOST_HAS_INT128
138 // C++0x features in 4.3.n and later
140 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
141 // 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
143 // __GXX_EXPERIMENTAL_CXX0X__.
144 # define BOOST_HAS_DECLTYPE
145 # define BOOST_HAS_RVALUE_REFS
146 # define BOOST_HAS_STATIC_ASSERT
147 # define BOOST_HAS_VARIADIC_TMPL
149 # define BOOST_NO_CXX11_DECLTYPE
150 # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
151 # define BOOST_NO_CXX11_RVALUE_REFERENCES
152 # define BOOST_NO_CXX11_STATIC_ASSERT
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
159 # define BOOST_NO_CXX11_VARIADIC_TEMPLATES
163 // C++0x features in 4.4.n and later
165 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
166 # define BOOST_NO_CXX11_AUTO_DECLARATIONS
167 # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
168 # define BOOST_NO_CXX11_CHAR16_T
169 # define BOOST_NO_CXX11_CHAR32_T
170 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
171 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
172 # define BOOST_NO_CXX11_DELETED_FUNCTIONS
173 # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
174 # define BOOST_NO_CXX11_INLINE_NAMESPACES
177 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
178 # define BOOST_NO_SFINAE_EXPR
181 // 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)
183 # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS
186 // C++0x features in 4.5.0 and later
188 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
189 # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
190 # define BOOST_NO_CXX11_LAMBDAS
191 # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
192 # define BOOST_NO_CXX11_RAW_LITERALS
193 # define BOOST_NO_CXX11_UNICODE_LITERALS
196 // C++0x features in 4.5.1 and later
198 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
199 // 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
201 # define BOOST_NO_CXX11_SCOPED_ENUMS
204 // C++0x features in 4.6.n and later
206 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
207 #define BOOST_NO_CXX11_CONSTEXPR
208 #define BOOST_NO_CXX11_NOEXCEPT
209 #define BOOST_NO_CXX11_NULLPTR
210 #define BOOST_NO_CXX11_RANGE_BASED_FOR
211 #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
214 // C++0x features in 4.7.n and later
216 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
217 # define BOOST_NO_CXX11_TEMPLATE_ALIASES
218 # define BOOST_NO_CXX11_USER_DEFINED_LITERALS
221 // C++0x features in 4.8.n and later
223 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
224 # define BOOST_NO_CXX11_ALIGNAS
227 // C++0x features in 4.8.1 and later
229 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
230 # define BOOST_NO_CXX11_DECLTYPE_N3276
233 #ifndef BOOST_COMPILER
234 # define BOOST_COMPILER "GNU C++ version " __VERSION__
237 // ConceptGCC compiler:
238 // http://www.generic-programming.org/software/ConceptGCC/
239 #ifdef __GXX_CONCEPTS__
240 # define BOOST_HAS_CONCEPTS
241 # define BOOST_COMPILER "ConceptGCC version " __VERSION__
245 // we don't know gcc prior to version 3.30:
246 #if (__GNUC__ < 3) || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3))
247 # error "Compiler not configured - please reconfigure"
250 // last known and checked version is 4.6 (Pre-release):
251 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
252 # if defined(BOOST_ASSERT_CONFIG)
253 # error "Unknown compiler version - please run the configure tests and report the results"
255 // 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...
257 //# warning "Unknown compiler version - please run the configure tests and report the results"