]> git.lyx.org Git - features.git/blob - boost/boost/config/compiler/gcc.hpp
6cae94cae679ef7f8705fce838613f1946477930
[features.git] / boost / 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 #if __GNUC__ < 3
17 #   if __GNUC_MINOR__ == 91
18        // egcs 1.1 won't parse shared_ptr.hpp without this:
19 #      define BOOST_NO_AUTO_PTR
20 #   endif
21 #   if __GNUC_MINOR__ < 95
22       //
23       // Prior to gcc 2.95 member templates only partly
24       // work - define BOOST_MSVC6_MEMBER_TEMPLATES
25       // instead since inline member templates mostly work.
26       //
27 #     define BOOST_NO_MEMBER_TEMPLATES
28 #     if __GNUC_MINOR__ >= 9
29 #       define BOOST_MSVC6_MEMBER_TEMPLATES
30 #     endif
31 #   endif
32
33 #   if __GNUC_MINOR__ < 96
34 #     define BOOST_NO_SFINAE
35 #   endif
36
37 #   if __GNUC_MINOR__ <= 97
38 #     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
39 #     define BOOST_NO_OPERATORS_IN_NAMESPACE
40 #   endif
41
42 #   define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
43 #   define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
44 #   define BOOST_NO_IS_ABSTRACT
45 #elif __GNUC__ == 3
46 #  if defined (__PATHSCALE__)
47 #     define BOOST_NO_TWO_PHASE_NAME_LOOKUP
48 #     define BOOST_NO_IS_ABSTRACT
49 #  endif
50    //
51    // gcc-3.x problems:
52    //
53    // Bug specific to gcc 3.1 and 3.2:
54    //
55 #  if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
56 #     define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
57 #  endif
58 #  if __GNUC_MINOR__ < 4
59 #     define BOOST_NO_IS_ABSTRACT
60 #  endif
61 #endif
62 #if __GNUC__ < 4
63 //
64 // All problems to gcc-3.x and earlier here:
65 //
66 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
67 #  ifdef __OPEN64__
68 #     define BOOST_NO_IS_ABSTRACT
69 #  endif
70 #endif
71
72 #ifndef __EXCEPTIONS
73 # define BOOST_NO_EXCEPTIONS
74 #endif
75
76
77 //
78 // Threading support: Turn this on unconditionally here (except for
79 // those platforms where we can know for sure). It will get turned off again
80 // later if no threading API is detected.
81 //
82 #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
83 # define BOOST_HAS_THREADS
84 #endif 
85
86 //
87 // gcc has "long long"
88 //
89 #define BOOST_HAS_LONG_LONG
90
91 //
92 // gcc implements the named return value optimization since version 3.1
93 //
94 #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
95 #define BOOST_HAS_NRVO
96 #endif
97 //
98 // RTTI and typeinfo detection is possible post gcc-4.3:
99 //
100 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
101 #  ifndef __GXX_RTTI
102 #     define BOOST_NO_TYPEID
103 #     define BOOST_NO_RTTI
104 #  endif
105 #endif
106
107 // C++0x features not implemented in any GCC version
108 //
109 #define BOOST_NO_CONSTEXPR
110 #define BOOST_NO_EXTERN_TEMPLATE
111 #define BOOST_NO_LAMBDAS
112 #define BOOST_NO_NULLPTR
113 #define BOOST_NO_RAW_LITERALS
114 #define BOOST_NO_TEMPLATE_ALIASES
115 #define BOOST_NO_UNICODE_LITERALS
116
117 // C++0x features in 4.3.n and later
118 //
119 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
120 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
121 // passed on the command line, which in turn defines
122 // __GXX_EXPERIMENTAL_CXX0X__.
123 #  define BOOST_HAS_DECLTYPE
124 #  define BOOST_HAS_RVALUE_REFS
125 #  define BOOST_HAS_STATIC_ASSERT
126 #  define BOOST_HAS_VARIADIC_TMPL
127 #else
128 #  define BOOST_NO_DECLTYPE
129 #  define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
130 #  define BOOST_NO_RVALUE_REFERENCES
131 #  define BOOST_NO_STATIC_ASSERT
132
133 // Variadic templates compiler: 
134 //   http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
135 #  ifdef __VARIADIC_TEMPLATES
136 #    define BOOST_HAS_VARIADIC_TMPL
137 #  else
138 #    define BOOST_NO_VARIADIC_TEMPLATES
139 #  endif
140 #endif
141
142 // C++0x features in 4.4.n and later
143 //
144 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
145 #  define BOOST_NO_AUTO_DECLARATIONS
146 #  define BOOST_NO_AUTO_MULTIDECLARATIONS
147 #  define BOOST_NO_CHAR16_T
148 #  define BOOST_NO_CHAR32_T
149 #  define BOOST_NO_DEFAULTED_FUNCTIONS
150 #  define BOOST_NO_DELETED_FUNCTIONS
151 #  define BOOST_NO_INITIALIZER_LISTS
152 #  define BOOST_NO_SCOPED_ENUMS  
153 #endif
154
155 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
156 #  define BOOST_NO_SFINAE_EXPR
157 #endif
158
159 // C++0x features in 4.4.1 and later
160 //
161 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40401) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
162 // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.4.1
163 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
164 #  define BOOST_NO_SCOPED_ENUMS
165 #endif
166
167 // C++0x features in 4.5.n and later
168 //
169 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
170 #  define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
171 #endif
172
173 // ConceptGCC compiler:
174 //   http://www.generic-programming.org/software/ConceptGCC/
175 #ifdef __GXX_CONCEPTS__
176 #  define BOOST_HAS_CONCEPTS
177 #  define BOOST_COMPILER "ConceptGCC version " __VERSION__
178 #else
179 #  define BOOST_NO_CONCEPTS
180 #endif
181
182 #ifndef BOOST_COMPILER
183 #  define BOOST_COMPILER "GNU C++ version " __VERSION__
184 #endif
185
186 //
187 // versions check:
188 // we don't know gcc prior to version 2.90:
189 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
190 #  error "Compiler not configured - please reconfigure"
191 #endif
192 //
193 // last known and checked version is 4.4 (Pre-release):
194 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 4))
195 #  if defined(BOOST_ASSERT_CONFIG)
196 #     error "Unknown compiler version - please run the configure tests and report the results"
197 #  else
198 // we don't emit warnings here anymore since there are no defect macros defined for
199 // gcc post 3.4, so any failures are gcc regressions...
200 //#     warning "Unknown compiler version - please run the configure tests and report the results"
201 #  endif
202 #endif
203
204