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 { }
76 // Macros for activating various namespace association modes.
77 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
78 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
79 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
82 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
85 #ifdef _GLIBCXX_PARALLEL
86 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
89 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
91 // Defined if any namespace association modes are active.
92 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
93 || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
94 || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
95 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
98 // Macros for namespace scope. Either namespace std:: or __gnu_cxx::,
99 // or the name of some nested namespace within it.
108 // Macros for enclosing namepaces and possibly nested namespaces.
109 // _GLIBCXX_BEGIN_NAMESPACE
110 // _GLIBCXX_END_NAMESPACE
111 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
112 // _GLIBCXX_END_NESTED_NAMESPACE
113 // _GLIBCXX_BEGIN_POTENTIAL_NESTED_NAMESPACE
114 // _GLIBCXX_END_POTENTIAL_NESTED_NAMESPACE
115 #ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
116 # define _GLIBCXX_STD_D _GLIBCXX_STD
117 # define _GLIBCXX_STD_P _GLIBCXX_STD
118 # define _GLIBCXX_STD std
119 # define _GLIBCXX_EXT_D _GLIBCXX_EXT
120 # define _GLIBCXX_EXT_P _GLIBCXX_EXT
121 # define _GLIBCXX_EXT __gnu_cxx
122 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
123 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
124 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
125 # define _GLIBCXX_END_NAMESPACE }
128 # if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
129 # define _GLIBCXX_STD_D _GLIBCXX_STD
130 # define _GLIBCXX_STD_P _GLIBCXX_STD
131 # define _GLIBCXX_STD _6
132 # define _GLIBCXX_EXT _6
133 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
134 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
138 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
139 # define _GLIBCXX_STD_D __norm
140 # define _GLIBCXX_STD_P _GLIBCXX_STD
141 # define _GLIBCXX_STD __cxx1998
142 # define _GLIBCXX_EXT_D __norm
143 # define _GLIBCXX_EXT_P _GLIBCXX_EXT
144 # define _GLIBCXX_EXT __cxx1998
145 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
146 # define _GLIBCXX_END_NAMESPACE }
147 # define _GLIBCXX_EXTERN_TEMPLATE 0
151 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
152 # define _GLIBCXX_STD_D _GLIBCXX_STD
153 # define _GLIBCXX_STD_P __norm
154 # define _GLIBCXX_STD __cxx1998
155 # define _GLIBCXX_EXT_D _GLIBCXX_EXT
156 # define _GLIBCXX_EXT_P __norm
157 # define _GLIBCXX_EXT __cxx1998
158 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
159 # define _GLIBCXX_END_NAMESPACE }
160 # define _GLIBCXX_EXTERN_TEMPLATE 0
164 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
165 # define _GLIBCXX_STD_D __norm
166 # define _GLIBCXX_STD_P __norm
167 # define _GLIBCXX_STD __cxx1998
168 # define _GLIBCXX_EXT_D __norm
169 # define _GLIBCXX_EXT_P __norm
170 # define _GLIBCXX_EXT __gnu_cxx
171 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
172 # define _GLIBCXX_END_NAMESPACE }
173 # define _GLIBCXX_EXTERN_TEMPLATE 0
176 # if __NO_INLINE__ && !__GXX_WEAK__
177 # warning currently using namepace associated mode which may fail \
178 without inlining due to lack of weak symbols
181 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
182 # define _GLIBCXX_END_NESTED_NAMESPACE } }
185 // Namespace associations for debug mode.
186 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
190 namespace __debug { }
191 namespace __cxx1998 { }
193 using namespace __debug __attribute__ ((strong));
194 using namespace __cxx1998 __attribute__ ((strong));
200 namespace __debug { }
201 namespace __cxx1998 { }
203 using namespace __debug __attribute__ ((strong));
204 using namespace __cxx1998 __attribute__ ((strong));
208 // Namespace associations for parallel mode.
209 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
213 namespace __parallel { }
214 namespace __cxx1998 { }
216 using namespace __parallel __attribute__ ((strong));
217 using namespace __cxx1998 __attribute__ ((strong));
223 namespace __parallel { }
224 namespace __cxx1998 { }
226 using namespace __parallel __attribute__ ((strong));
227 using namespace __cxx1998 __attribute__ ((strong));
231 // Namespace associations for versioning mode.
232 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
236 using namespace _6 __attribute__ ((strong));
242 using namespace _6 __attribute__ ((strong));
250 using namespace _6 __attribute__ ((strong));
255 // Define if compatibility should be provided for -mlong-double-64.
256 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
258 // XXX GLIBCXX_ABI Deprecated
259 // Namespace associations for long double 128 mode.
260 _GLIBCXX_BEGIN_NAMESPACE(std)
261 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
262 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
263 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
264 # define _GLIBCXX_END_LDBL_NAMESPACE }
265 namespace __gnu_cxx_ldbl128 { }
266 using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
268 # define _GLIBCXX_LDBL_NAMESPACE
269 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
270 # define _GLIBCXX_END_LDBL_NAMESPACE
272 _GLIBCXX_END_NAMESPACE
275 // Allow use of "export template." This is currently not a feature
276 // that g++ supports.
277 // #define _GLIBCXX_EXPORT_TEMPLATE 1
279 // Allow use of the GNU syntax extension, "extern template." This
280 // extension is fully documented in the g++ manual, but in a nutshell,
281 // it inhibits all implicit instantiations and is used throughout the
282 // library to avoid multiple weak definitions for required types that
283 // are already explicitly instantiated in the library binary. This
284 // substantially reduces the binary size of resulting executables.
285 #ifndef _GLIBCXX_EXTERN_TEMPLATE
286 # define _GLIBCXX_EXTERN_TEMPLATE 1
290 // Certain function definitions that are meant to be overridable from
291 // user code are decorated with this macro. For some targets, this
292 // macro causes these definitions to be weak.
293 #ifndef _GLIBCXX_WEAK_DEFINITION
294 # define _GLIBCXX_WEAK_DEFINITION
297 // Macro used to indicate that the native "C" includes, when compiled
298 // as "C++", have declarations in namespace std and not the global
299 // namespace. Note, this is unrelated to possible "C" compatibility
300 // includes that inject C90/C99 names into the global namespace.
301 #if __cplusplus == 199711L
302 # define _GLIBCXX_NAMESPACE_GLOBAL_INJECTION 1
305 // The remainder of the prewritten config is automatic; all the
306 // user hooks are listed above.
308 // Create a boolean flag to be used to determine if --fast-math is set.
310 # define _GLIBCXX_FAST_MATH 1
312 # define _GLIBCXX_FAST_MATH 0
315 // This marks string literals in header files to be extracted for eventual
316 // translation. It is primarily used for messages in thrown exceptions; see
317 // src/functexcept.cc. We use __N because the more traditional _N is used
318 // for something else under certain OSes (see BADNAMES).
319 #define __N(msgid) (msgid)
321 // For example, <windows.h> is known to #define min and max as macros...
325 // End of prewritten config; the discovered settings follow.