1 // Predefined symbols and macros -*- C++ -*-
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008 Free Software Foundation, Inc.
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 2, or (at your option)
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.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
32 * This is an internal header file, included by other library headers.
33 * You should not attempt to use it directly.
36 #ifndef _GLIBCXX_CXX_CONFIG_H
37 #define _GLIBCXX_CXX_CONFIG_H 1
39 // The current version of the C++ library in compressed ISO date format.
42 // Macros for visibility.
43 // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
44 // _GLIBCXX_VISIBILITY_ATTR
45 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
47 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
48 # define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
50 # define _GLIBCXX_VISIBILITY_ATTR(V)
53 // Macros for deprecated.
54 // _GLIBCXX_DEPRECATED
55 // _GLIBCXX_DEPRECATED_ATTR
56 #ifndef _GLIBCXX_DEPRECATED
57 # define _GLIBCXX_DEPRECATED 1
60 #if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
61 # define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
63 # define _GLIBCXX_DEPRECATED_ATTR
66 // Macros for activating various namespace association modes.
67 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
68 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
69 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
71 // Guide to libstdc++ namespaces.
76 namespace __parallel { }
77 namespace __norm { } // __normative, __shadow, __replaced
78 namespace __cxx1998 { }
86 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
89 #ifdef _GLIBCXX_PARALLEL
90 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
93 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
95 // Defined if any namespace association modes are active.
96 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
97 || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
98 || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
99 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
102 // Macros for namespace scope. Either namespace std:: or the name
103 // of some nested namespace within it.
108 // Macros for enclosing namespaces and possibly nested namespaces.
109 // _GLIBCXX_BEGIN_NAMESPACE
110 // _GLIBCXX_END_NAMESPACE
111 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
112 // _GLIBCXX_END_NESTED_NAMESPACE
113 #ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
114 # define _GLIBCXX_STD_D _GLIBCXX_STD
115 # define _GLIBCXX_STD_P _GLIBCXX_STD
116 # define _GLIBCXX_STD std
117 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
118 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
119 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
120 # define _GLIBCXX_END_NAMESPACE }
123 # if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
124 # define _GLIBCXX_STD_D _GLIBCXX_STD
125 # define _GLIBCXX_STD_P _GLIBCXX_STD
126 # define _GLIBCXX_STD _6
127 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
128 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
132 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
133 # define _GLIBCXX_STD_D __norm
134 # define _GLIBCXX_STD_P _GLIBCXX_STD
135 # define _GLIBCXX_STD __cxx1998
136 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
137 # define _GLIBCXX_END_NAMESPACE }
138 # define _GLIBCXX_EXTERN_TEMPLATE 0
142 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
143 # define _GLIBCXX_STD_D _GLIBCXX_STD
144 # define _GLIBCXX_STD_P __norm
145 # define _GLIBCXX_STD __cxx1998
146 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
147 # define _GLIBCXX_END_NAMESPACE }
148 # define _GLIBCXX_EXTERN_TEMPLATE 0
152 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
153 # define _GLIBCXX_STD_D __norm
154 # define _GLIBCXX_STD_P __norm
155 # define _GLIBCXX_STD __cxx1998
156 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
157 # define _GLIBCXX_END_NAMESPACE }
158 # define _GLIBCXX_EXTERN_TEMPLATE 0
161 # if __NO_INLINE__ && !__GXX_WEAK__
162 # warning currently using namespace associated mode which may fail \
163 without inlining due to lack of weak symbols
166 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
167 # define _GLIBCXX_END_NESTED_NAMESPACE } }
170 // Namespace associations for debug mode.
171 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
175 inline namespace __debug { }
176 inline namespace __cxx1998 { }
180 // Namespace associations for parallel mode.
181 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
185 inline namespace __parallel { }
186 inline namespace __cxx1998 { }
190 // Namespace associations for versioning mode.
191 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
194 inline namespace _6 { }
199 inline namespace _6 { }
206 inline namespace _6 { }
211 // XXX GLIBCXX_ABI Deprecated
212 // Define if compatibility should be provided for -mlong-double-64
213 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
215 // Namespace associations for long double 128 mode.
216 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
219 inline namespace __gnu_cxx_ldbl128 { }
221 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
222 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
223 # define _GLIBCXX_END_LDBL_NAMESPACE }
225 # define _GLIBCXX_LDBL_NAMESPACE
226 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
227 # define _GLIBCXX_END_LDBL_NAMESPACE
231 // Defines for C compatibility. In particular, define extern "C"
232 // linkage only when using C++.
233 # define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
234 # define _GLIBCXX_END_EXTERN_C }
236 #else // !__cplusplus
237 # undef _GLIBCXX_BEGIN_NAMESPACE
238 # undef _GLIBCXX_END_NAMESPACE
239 # define _GLIBCXX_BEGIN_NAMESPACE(X)
240 # define _GLIBCXX_END_NAMESPACE
241 # define _GLIBCXX_BEGIN_EXTERN_C
242 # define _GLIBCXX_END_EXTERN_C
247 // Pick up any OS-specific definitions.
248 #include <bits/os_defines.h>
250 // Pick up any CPU-specific definitions.
251 #include <bits/cpu_defines.h>
253 // Allow use of "export template." This is currently not a feature
254 // that g++ supports.
255 // #define _GLIBCXX_EXPORT_TEMPLATE 1
257 // Allow use of the GNU syntax extension, "extern template." This
258 // extension is fully documented in the g++ manual, but in a nutshell,
259 // it inhibits all implicit instantiations and is used throughout the
260 // library to avoid multiple weak definitions for required types that
261 // are already explicitly instantiated in the library binary. This
262 // substantially reduces the binary size of resulting executables.
263 #ifndef _GLIBCXX_EXTERN_TEMPLATE
264 # define _GLIBCXX_EXTERN_TEMPLATE 1
267 // Certain function definitions that are meant to be overridable from
268 // user code are decorated with this macro. For some targets, this
269 // macro causes these definitions to be weak.
270 #ifndef _GLIBCXX_WEAK_DEFINITION
271 # define _GLIBCXX_WEAK_DEFINITION
274 // The remainder of the prewritten config is automatic; all the
275 // user hooks are listed above.
277 // Create a boolean flag to be used to determine if --fast-math is set.
279 # define _GLIBCXX_FAST_MATH 1
281 # define _GLIBCXX_FAST_MATH 0
284 // This marks string literals in header files to be extracted for eventual
285 // translation. It is primarily used for messages in thrown exceptions; see
286 // src/functexcept.cc. We use __N because the more traditional _N is used
287 // for something else under certain OSes (see BADNAMES).
288 #define __N(msgid) (msgid)
290 // For example, <windows.h> is known to #define min and max as macros...
294 // End of prewritten config; the discovered settings follow.