]> git.donarmstrong.com Git - rsem.git/blob - boost/config/compiler/gcc.hpp
Updated boost to v1.55.0
[rsem.git] / boost / config / compiler / gcc.hpp
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)
11
12 //  See http://www.boost.org for most recent version.
13
14 //  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
22
23 #if __GNUC__ == 3
24 #  if defined (__PATHSCALE__)
25 #     define BOOST_NO_TWO_PHASE_NAME_LOOKUP
26 #     define BOOST_NO_IS_ABSTRACT
27 #  endif
28
29 #  if __GNUC_MINOR__ < 4
30 #     define BOOST_NO_IS_ABSTRACT
31 #  endif
32 #  define BOOST_NO_CXX11_EXTERN_TEMPLATE
33 #endif
34 #if __GNUC__ < 4
35 //
36 // All problems to gcc-3.x and earlier here:
37 //
38 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
39 #  ifdef __OPEN64__
40 #     define BOOST_NO_IS_ABSTRACT
41 #  endif
42 #endif
43
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
47 #endif
48
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
59 #endif
60
61 #if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
62 # define BOOST_NO_EXCEPTIONS
63 #endif
64
65
66 //
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.
70 //
71 #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
72 # define BOOST_HAS_THREADS
73 #endif
74
75 //
76 // gcc has "long long"
77 //
78 #define BOOST_HAS_LONG_LONG
79
80 //
81 // gcc implements the named return value optimization since version 3.1
82 //
83 #define BOOST_HAS_NRVO
84
85 // Branch prediction hints
86 #define BOOST_LIKELY(x) __builtin_expect(x, 1)
87 #define BOOST_UNLIKELY(x) __builtin_expect(x, 0)
88
89 //
90 // Dynamic shared object (DSO) and dynamic-link library (DLL) support
91 //
92 #if __GNUC__ >= 4
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__))
100 #  else
101 #    define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default")))
102 #    define BOOST_SYMBOL_IMPORT
103 #  endif
104 #  define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
105 #else
106 // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
107 #  define BOOST_SYMBOL_EXPORT
108 #endif
109
110 //
111 // RTTI and typeinfo detection is possible post gcc-4.3:
112 //
113 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
114 #  ifndef __GXX_RTTI
115 #     ifndef BOOST_NO_TYPEID
116 #        define BOOST_NO_TYPEID
117 #     endif
118 #     ifndef BOOST_NO_RTTI
119 #        define BOOST_NO_RTTI
120 #     endif
121 #  endif
122 #endif
123
124 //
125 // Recent GCC versions have __int128 when in 64-bit mode.
126 //
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:
133 //
134 #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
135 #  define BOOST_HAS_INT128
136 #endif
137
138 // C++0x features in 4.3.n and later
139 //
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
148 #else
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
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
163 // C++0x features in 4.4.n and later
164 //
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
175 #endif
176
177 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
178 #  define BOOST_NO_SFINAE_EXPR
179 #endif
180
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
184 #endif
185
186 // C++0x features in 4.5.0 and later
187 //
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
194 #endif
195
196 // C++0x features in 4.5.1 and later
197 //
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
202 #endif
203
204 // C++0x features in 4.6.n and later
205 //
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
212 #endif
213
214 // C++0x features in 4.7.n and later
215 //
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
219 #endif
220
221 // C++0x features in 4.8.n and later
222 //
223 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
224 #  define BOOST_NO_CXX11_ALIGNAS
225 #endif
226
227 // C++0x features in 4.8.1 and later
228 //
229 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
230 #  define BOOST_NO_CXX11_DECLTYPE_N3276
231 #endif
232
233 #ifndef BOOST_COMPILER
234 #  define BOOST_COMPILER "GNU C++ version " __VERSION__
235 #endif
236
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__
242 #endif
243
244 // versions check:
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"
248 #endif
249 //
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"
254 #  else
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"
258 #  endif
259 #endif
260
261