1 // Predefined symbols and macros -*- C++ -*-
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007 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 // Pick up any OS-specific definitions.
40 #include <bits/os_defines.h>
42 // Pick up any CPU-specific definitions.
43 #include <bits/cpu_defines.h>
45 // The current version of the C++ library in compressed ISO date format.
48 // Macros for visibility support.
49 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
51 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
52 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
54 # define _GLIBCXX_VISIBILITY(V)
57 // Guide to libstdc++ namespaces.
62 namespace __parallel { }
63 namespace __norm { } // __normative, __shadow, __replaced
64 namespace __cxx1998 { }
70 // Macros for activating various namespace association modes.
71 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
72 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
73 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
76 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
79 #ifdef _GLIBCXX_PARALLEL
80 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
83 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
85 // Defined if any namespace association modes are active.
86 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
87 || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
88 || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
89 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
92 // Macros for namespace scope. Either namespace std:: or __gnu_cxx::,
93 // or the name of some nested namespace within it.
99 // Macros for enclosing namepaces and possibly nested namespaces.
100 // _GLIBCXX_BEGIN_NAMESPACE
101 // _GLIBCXX_END_NAMESPACE
102 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
103 // _GLIBCXX_END_NESTED_NAMESPACE
104 // _GLIBCXX_BEGIN_POTENTIAL_NESTED_NAMESPACE
105 // _GLIBCXX_END_POTENTIAL_NESTED_NAMESPACE
106 #ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
107 # define _GLIBCXX_STD_D _GLIBCXX_STD
108 # define _GLIBCXX_STD_P _GLIBCXX_STD
109 # define _GLIBCXX_STD std
110 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
111 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
112 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
113 # define _GLIBCXX_END_NAMESPACE }
116 # if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
117 # define _GLIBCXX_STD_D _GLIBCXX_STD
118 # define _GLIBCXX_STD_P _GLIBCXX_STD
119 # define _GLIBCXX_STD _6
120 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
121 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
125 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
126 # define _GLIBCXX_STD_D __norm
127 # define _GLIBCXX_STD_P _GLIBCXX_STD
128 # define _GLIBCXX_STD __cxx1998
129 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
130 # define _GLIBCXX_END_NAMESPACE }
131 # define _GLIBCXX_EXTERN_TEMPLATE 0
135 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
136 # define _GLIBCXX_STD_D _GLIBCXX_STD
137 # define _GLIBCXX_STD_P __norm
138 # define _GLIBCXX_STD __cxx1998
139 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
140 # define _GLIBCXX_END_NAMESPACE }
141 # define _GLIBCXX_EXTERN_TEMPLATE 0
145 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
146 # define _GLIBCXX_STD_D __norm
147 # define _GLIBCXX_STD_P __norm
148 # define _GLIBCXX_STD __cxx1998
149 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
150 # define _GLIBCXX_END_NAMESPACE }
151 # define _GLIBCXX_EXTERN_TEMPLATE 0
154 # if __NO_INLINE__ && !__GXX_WEAK__
155 # warning currently using namepace associated mode which may fail \
156 without inlining due to lack of weak symbols
159 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
160 # define _GLIBCXX_END_NESTED_NAMESPACE } }
163 // Namespace associations for debug mode.
164 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
168 namespace __debug { }
169 namespace __cxx1998 { }
171 using namespace __debug __attribute__ ((strong));
172 using namespace __cxx1998 __attribute__ ((strong));
176 // Namespace associations for parallel mode.
177 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
181 namespace __parallel { }
182 namespace __cxx1998 { }
184 using namespace __parallel __attribute__ ((strong));
185 using namespace __cxx1998 __attribute__ ((strong));
189 // Namespace associations for versioning mode.
190 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
194 using namespace _6 __attribute__ ((strong));
200 using namespace _6 __attribute__ ((strong));
208 using namespace _6 __attribute__ ((strong));
213 // Define if compatibility should be provided for -mlong-double-64.
214 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
216 // XXX GLIBCXX_ABI Deprecated
217 // Namespace associations for long double 128 mode.
218 _GLIBCXX_BEGIN_NAMESPACE(std)
219 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
220 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
221 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
222 # define _GLIBCXX_END_LDBL_NAMESPACE }
223 namespace __gnu_cxx_ldbl128 { }
224 using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
226 # define _GLIBCXX_LDBL_NAMESPACE
227 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
228 # define _GLIBCXX_END_LDBL_NAMESPACE
230 _GLIBCXX_END_NAMESPACE
233 // Allow use of "export template." This is currently not a feature
234 // that g++ supports.
235 // #define _GLIBCXX_EXPORT_TEMPLATE 1
237 // Allow use of the GNU syntax extension, "extern template." This
238 // extension is fully documented in the g++ manual, but in a nutshell,
239 // it inhibits all implicit instantiations and is used throughout the
240 // library to avoid multiple weak definitions for required types that
241 // are already explicitly instantiated in the library binary. This
242 // substantially reduces the binary size of resulting executables.
243 #ifndef _GLIBCXX_EXTERN_TEMPLATE
244 # define _GLIBCXX_EXTERN_TEMPLATE 1
248 // Certain function definitions that are meant to be overridable from
249 // user code are decorated with this macro. For some targets, this
250 // macro causes these definitions to be weak.
251 #ifndef _GLIBCXX_WEAK_DEFINITION
252 # define _GLIBCXX_WEAK_DEFINITION
255 // Macro used to indicate that the native "C" includes, when compiled
256 // as "C++", have declarations in namespace std and not the global
257 // namespace. Note, this is unrelated to possible "C" compatibility
258 // includes that inject C90/C99 names into the global namespace.
259 #if __cplusplus == 199711L
260 # define _GLIBCXX_NAMESPACE_GLOBAL_INJECTION 1
263 // The remainder of the prewritten config is automatic; all the
264 // user hooks are listed above.
266 // Create a boolean flag to be used to determine if --fast-math is set.
268 # define _GLIBCXX_FAST_MATH 1
270 # define _GLIBCXX_FAST_MATH 0
273 // This marks string literals in header files to be extracted for eventual
274 // translation. It is primarily used for messages in thrown exceptions; see
275 // src/functexcept.cc. We use __N because the more traditional _N is used
276 // for something else under certain OSes (see BADNAMES).
277 #define __N(msgid) (msgid)
279 // For example, <windows.h> is known to #define min and max as macros...
283 // End of prewritten config; the discovered settings follow.