]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/bits/c++config
c++config: Revert inadvertent change.
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / c++config
1 // Predefined symbols and macros -*- C++ -*-
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /** @file c++config.h
27 * This is an internal header file, included by other library headers.
28 * You should not attempt to use it directly.
29 */
30
31 #ifndef _GLIBCXX_CXX_CONFIG_H
32 #define _GLIBCXX_CXX_CONFIG_H 1
33
34 // The current version of the C++ library in compressed ISO date format.
35 #define __GLIBCXX__
36
37 // Macros for visibility.
38 // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
39 // _GLIBCXX_VISIBILITY_ATTR
40 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
41
42 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
43 # define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
44 #else
45 # define _GLIBCXX_VISIBILITY_ATTR(V)
46 #endif
47
48 // Macros for deprecated.
49 // _GLIBCXX_DEPRECATED
50 // _GLIBCXX_DEPRECATED_ATTR
51 #ifndef _GLIBCXX_DEPRECATED
52 # define _GLIBCXX_DEPRECATED 1
53 #endif
54
55 #if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
56 # define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
57 #else
58 # define _GLIBCXX_DEPRECATED_ATTR
59 #endif
60
61 // Macros for activating various namespace association modes.
62 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
63 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
64 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
65
66 // Guide to libstdc++ namespaces.
67 /*
68 namespace std
69 {
70 namespace __debug { }
71 namespace __parallel { }
72 namespace __norm { } // __normative, __shadow, __replaced
73 namespace __cxx1998 { }
74
75 namespace tr1 { }
76 }
77 */
78 #if __cplusplus
79
80 #ifdef _GLIBCXX_DEBUG
81 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
82 #endif
83
84 #ifdef _GLIBCXX_PARALLEL
85 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
86 #endif
87
88 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
89
90 // Defined if any namespace association modes are active.
91 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
92 || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
93 || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
94 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
95 #endif
96
97 // Macros for namespace scope. Either namespace std:: or the name
98 // of some nested namespace within it.
99 // _GLIBCXX_STD
100 // _GLIBCXX_STD_D
101 // _GLIBCXX_STD_P
102 //
103 // Macros for enclosing namespaces and possibly nested namespaces.
104 // _GLIBCXX_BEGIN_NAMESPACE
105 // _GLIBCXX_END_NAMESPACE
106 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
107 // _GLIBCXX_END_NESTED_NAMESPACE
108 #ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
109 # define _GLIBCXX_STD_D _GLIBCXX_STD
110 # define _GLIBCXX_STD_P _GLIBCXX_STD
111 # define _GLIBCXX_STD std
112 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
113 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
114 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
115 # define _GLIBCXX_END_NAMESPACE }
116 #else
117
118 # if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
119 # define _GLIBCXX_STD_D _GLIBCXX_STD
120 # define _GLIBCXX_STD_P _GLIBCXX_STD
121 # define _GLIBCXX_STD _6
122 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
123 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
124 # endif
125
126 // debug
127 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
128 # define _GLIBCXX_STD_D __norm
129 # define _GLIBCXX_STD_P _GLIBCXX_STD
130 # define _GLIBCXX_STD __cxx1998
131 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
132 # define _GLIBCXX_END_NAMESPACE }
133 # define _GLIBCXX_EXTERN_TEMPLATE -1
134 # endif
135
136 // parallel
137 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
138 # define _GLIBCXX_STD_D _GLIBCXX_STD
139 # define _GLIBCXX_STD_P __norm
140 # define _GLIBCXX_STD __cxx1998
141 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
142 # define _GLIBCXX_END_NAMESPACE }
143 # define _GLIBCXX_EXTERN_TEMPLATE -1
144 # endif
145
146 // debug + parallel
147 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
148 # define _GLIBCXX_STD_D __norm
149 # define _GLIBCXX_STD_P __norm
150 # define _GLIBCXX_STD __cxx1998
151 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
152 # define _GLIBCXX_END_NAMESPACE }
153 # define _GLIBCXX_EXTERN_TEMPLATE -1
154 # endif
155
156 # if __NO_INLINE__ && !__GXX_WEAK__
157 # warning currently using namespace associated mode which may fail \
158 without inlining due to lack of weak symbols
159 # endif
160
161 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
162 # define _GLIBCXX_END_NESTED_NAMESPACE } }
163 #endif
164
165 // Namespace associations for debug mode.
166 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
167 namespace std
168 {
169 namespace __norm { }
170 inline namespace __debug { }
171 inline namespace __cxx1998 { }
172 }
173 #endif
174
175 // Namespace associations for parallel mode.
176 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
177 namespace std
178 {
179 namespace __norm { }
180 inline namespace __parallel { }
181 inline namespace __cxx1998 { }
182 }
183 #endif
184
185 // Namespace associations for versioning mode.
186 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
187 namespace std
188 {
189 inline namespace _6 { }
190 }
191
192 namespace __gnu_cxx
193 {
194 inline namespace _6 { }
195 }
196
197 namespace std
198 {
199 namespace tr1
200 {
201 inline namespace _6 { }
202 }
203 }
204 #endif
205
206 // XXX GLIBCXX_ABI Deprecated
207 // Define if compatibility should be provided for -mlong-double-64
208 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
209
210 // Namespace associations for long double 128 mode.
211 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
212 namespace std
213 {
214 inline namespace __gnu_cxx_ldbl128 { }
215 }
216 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
217 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
218 # define _GLIBCXX_END_LDBL_NAMESPACE }
219 #else
220 # define _GLIBCXX_LDBL_NAMESPACE
221 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
222 # define _GLIBCXX_END_LDBL_NAMESPACE
223 #endif
224
225
226 // Defines for C compatibility. In particular, define extern "C"
227 // linkage only when using C++.
228 # define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
229 # define _GLIBCXX_END_EXTERN_C }
230
231 #else // !__cplusplus
232 # undef _GLIBCXX_BEGIN_NAMESPACE
233 # undef _GLIBCXX_END_NAMESPACE
234 # define _GLIBCXX_BEGIN_NAMESPACE(X)
235 # define _GLIBCXX_END_NAMESPACE
236 # define _GLIBCXX_BEGIN_EXTERN_C
237 # define _GLIBCXX_END_EXTERN_C
238 #endif
239
240 // First includes.
241
242 // Pick up any OS-specific definitions.
243 #include <bits/os_defines.h>
244
245 // Pick up any CPU-specific definitions.
246 #include <bits/cpu_defines.h>
247
248 // Allow use of "export template." This is currently not a feature
249 // that g++ supports.
250 // #define _GLIBCXX_EXPORT_TEMPLATE 1
251
252 // Allow use of the GNU syntax extension, "extern template." This
253 // extension is fully documented in the g++ manual, but in a nutshell,
254 // it inhibits all implicit instantiations and is used throughout the
255 // library to avoid multiple weak definitions for required types that
256 // are already explicitly instantiated in the library binary. This
257 // substantially reduces the binary size of resulting executables.
258 #ifndef _GLIBCXX_EXTERN_TEMPLATE
259 # define _GLIBCXX_EXTERN_TEMPLATE 1
260 #endif
261
262 // Certain function definitions that are meant to be overridable from
263 // user code are decorated with this macro. For some targets, this
264 // macro causes these definitions to be weak.
265 #ifndef _GLIBCXX_WEAK_DEFINITION
266 # define _GLIBCXX_WEAK_DEFINITION
267 #endif
268
269 // Assert.
270 // Avoid the use of assert, because we're trying to keep the <cassert>
271 // include out of the mix.
272 #if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL)
273 #define __glibcxx_assert(_Condition)
274 #else
275 _GLIBCXX_BEGIN_NAMESPACE(std)
276 // Avoid the use of assert, because we're trying to keep the <cassert>
277 // include out of the mix.
278 inline void
279 __replacement_assert(const char* __file, int __line,
280 const char* __function, const char* __condition)
281 {
282 __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
283 __function, __condition);
284 __builtin_abort();
285 }
286 _GLIBCXX_END_NAMESPACE
287
288 #define __glibcxx_assert(_Condition) \
289 do \
290 { \
291 if (! (_Condition)) \
292 std::__replacement_assert(__FILE__, __LINE__, \
293 __PRETTY_FUNCTION__, #_Condition); \
294 } while (false)
295 #endif
296
297 // The remainder of the prewritten config is automatic; all the
298 // user hooks are listed above.
299
300 // Create a boolean flag to be used to determine if --fast-math is set.
301 #ifdef __FAST_MATH__
302 # define _GLIBCXX_FAST_MATH 1
303 #else
304 # define _GLIBCXX_FAST_MATH 0
305 #endif
306
307 // This marks string literals in header files to be extracted for eventual
308 // translation. It is primarily used for messages in thrown exceptions; see
309 // src/functexcept.cc. We use __N because the more traditional _N is used
310 // for something else under certain OSes (see BADNAMES).
311 #define __N(msgid) (msgid)
312
313 // For example, <windows.h> is known to #define min and max as macros...
314 #undef min
315 #undef max
316
317 // End of prewritten config; the discovered settings follow.