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