1 // Predefined symbols and macros -*- C++ -*-
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008, 2009 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 3, 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 // 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.
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/>.
27 * This is an internal header file, included by other library headers.
28 * You should not attempt to use it directly.
31 #ifndef _GLIBCXX_CXX_CONFIG_H
32 #define _GLIBCXX_CXX_CONFIG_H 1
34 // The current version of the C++ library in compressed ISO date format.
37 // Macros for visibility.
38 // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
39 // _GLIBCXX_VISIBILITY_ATTR
40 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
42 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
43 # define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
45 # define _GLIBCXX_VISIBILITY_ATTR(V)
48 // Macros for deprecated.
49 // _GLIBCXX_DEPRECATED
50 // _GLIBCXX_DEPRECATED_ATTR
51 #ifndef _GLIBCXX_DEPRECATED
52 # define _GLIBCXX_DEPRECATED 1
55 #if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
56 # define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
58 # define _GLIBCXX_DEPRECATED_ATTR
61 // Macros for activating various namespace association modes.
62 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
63 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
64 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
66 // Guide to libstdc++ namespaces.
71 namespace __parallel { }
72 namespace __norm { } // __normative, __shadow, __replaced
73 namespace __cxx1998 { }
81 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
84 #ifdef _GLIBCXX_PARALLEL
85 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
88 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
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
97 // Macros for namespace scope. Either namespace std:: or the name
98 // of some nested namespace within it.
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 }
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
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
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
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
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
161 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
162 # define _GLIBCXX_END_NESTED_NAMESPACE } }
165 // Namespace associations for debug mode.
166 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
170 inline namespace __debug { }
171 inline namespace __cxx1998 { }
175 // Namespace associations for parallel mode.
176 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
180 inline namespace __parallel { }
181 inline namespace __cxx1998 { }
185 // Namespace associations for versioning mode.
186 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
189 inline namespace _6 { }
194 inline namespace _6 { }
201 inline namespace _6 { }
206 // XXX GLIBCXX_ABI Deprecated
207 // Define if compatibility should be provided for -mlong-double-64
208 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
210 // Namespace associations for long double 128 mode.
211 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
214 inline namespace __gnu_cxx_ldbl128 { }
216 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
217 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
218 # define _GLIBCXX_END_LDBL_NAMESPACE }
220 # define _GLIBCXX_LDBL_NAMESPACE
221 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
222 # define _GLIBCXX_END_LDBL_NAMESPACE
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 }
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
242 // Pick up any OS-specific definitions.
243 #include <bits/os_defines.h>
245 // Pick up any CPU-specific definitions.
246 #include <bits/cpu_defines.h>
248 // Allow use of "export template." This is currently not a feature
249 // that g++ supports.
250 // #define _GLIBCXX_EXPORT_TEMPLATE 1
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
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
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)
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.
279 __replacement_assert(const char* __file, int __line,
280 const char* __function, const char* __condition)
282 __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
283 __function, __condition);
286 _GLIBCXX_END_NAMESPACE
288 #define __glibcxx_assert(_Condition) \
291 if (! (_Condition)) \
292 std::__replacement_assert(__FILE__, __LINE__, \
293 __PRETTY_FUNCTION__, #_Condition); \
297 // The remainder of the prewritten config is automatic; all the
298 // user hooks are listed above.
300 // Create a boolean flag to be used to determine if --fast-math is set.
302 # define _GLIBCXX_FAST_MATH 1
304 # define _GLIBCXX_FAST_MATH 0
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)
313 // For example, <windows.h> is known to #define min and max as macros...
317 // End of prewritten config; the discovered settings follow.