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 // Macro used to indicate that the native "C" includes, when compiled
49 // as "C++", have declarations in namespace std and not the global
50 // namespace. Note, this is unrelated to possible "C" compatibility
51 // includes that inject C90/C99 names into the global namespace.
52 // XXX May not be necessary
53 #if __cplusplus == 199711L
54 # define _GLIBCXX_NAMESPACE_C 1
57 // Macros for visibility.
58 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
60 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
61 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
63 # define _GLIBCXX_VISIBILITY(V)
66 // Macros for controlling various namespace association schemes and modes.
67 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
68 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
69 // _GLIBCXX_NAMESPACE_ASSOCIATION_CXX200x
71 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
74 #ifdef __GXX_EXPERIMENTAL_CXX0X__
75 # define _GLIBCXX_NAMESPACE_ASSOCIATION_CXX0X 1
78 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
80 // Macros for namespace scope.
81 // _GLIBCXX_BEGIN_NAMESPACE
82 // _GLIBCXX_END_NAMESPACE
83 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
84 // _GLIBCXX_END_NESTED_NAMESPACE
85 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
86 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
87 # define _GLIBCXX_END_NESTED_NAMESPACE } }
88 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
89 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
91 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
92 # define _GLIBCXX_END_NAMESPACE }
93 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
94 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
95 # define _GLIBCXX_END_NESTED_NAMESPACE } }
97 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
98 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
102 // Namespace associations for versioning mode.
103 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
107 using namespace _6 __attribute__ ((strong));
113 using namespace _6 __attribute__ ((strong));
121 using namespace _6 __attribute__ ((strong));
126 // Namespace associations for debug mode.
127 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
131 namespace __debug { }
132 using namespace __debug __attribute__ ((strong));
138 namespace __debug { }
139 using namespace __debug __attribute__ ((strong));
142 # define _GLIBCXX_STD __norm
143 # define _GLIBCXX_EXT __norm
144 # define _GLIBCXX_EXTERN_TEMPLATE 0
145 # if __NO_INLINE__ && !__GXX_WEAK__
146 # warning debug mode without inlining may fail due to lack of weak symbols
149 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
150 # define _GLIBCXX_STD _6
151 # define _GLIBCXX_EXT _6
153 # define _GLIBCXX_STD std
154 # define _GLIBCXX_EXT __gnu_cxx
158 // Namespace associations for C++0x, TR1 in std.
159 #if _GLIBCXX_NAMESPACE_ASSOCIATION_CXX0X
162 namespace __cxx200x { }
163 using namespace __cxx200x __attribute__ ((strong));
165 # define _GLIBCXX_TR1 __cxx200x
167 # define _GLIBCXX_TR1 tr1
170 // Define if compatibility should be provided for -mlong-double-64.
171 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
173 // XXX GLIBCXX_ABI Deprecated
174 // Namespace associations for long double 128 mode.
175 _GLIBCXX_BEGIN_NAMESPACE(std)
176 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
177 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
178 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
179 # define _GLIBCXX_END_LDBL_NAMESPACE }
180 namespace __gnu_cxx_ldbl128 { }
181 using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
183 # define _GLIBCXX_LDBL_NAMESPACE
184 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
185 # define _GLIBCXX_END_LDBL_NAMESPACE
187 _GLIBCXX_END_NAMESPACE
190 // Allow use of "export template." This is currently not a feature
191 // that g++ supports.
192 // #define _GLIBCXX_EXPORT_TEMPLATE 1
194 // Allow use of the GNU syntax extension, "extern template." This
195 // extension is fully documented in the g++ manual, but in a nutshell,
196 // it inhibits all implicit instantiations and is used throughout the
197 // library to avoid multiple weak definitions for required types that
198 // are already explicitly instantiated in the library binary. This
199 // substantially reduces the binary size of resulting executables.
200 #ifndef _GLIBCXX_EXTERN_TEMPLATE
201 # define _GLIBCXX_EXTERN_TEMPLATE 1
205 // Certain function definitions that are meant to be overridable from
206 // user code are decorated with this macro. For some targets, this
207 // macro causes these definitions to be weak.
208 #ifndef _GLIBCXX_WEAK_DEFINITION
209 # define _GLIBCXX_WEAK_DEFINITION
212 // The remainder of the prewritten config is automatic; all the
213 // user hooks are listed above.
215 // Create a boolean flag to be used to determine if --fast-math is set.
217 # define _GLIBCXX_FAST_MATH 1
219 # define _GLIBCXX_FAST_MATH 0
222 // This marks string literals in header files to be extracted for eventual
223 // translation. It is primarily used for messages in thrown exceptions; see
224 // src/functexcept.cc. We use __N because the more traditional _N is used
225 // for something else under certain OSes (see BADNAMES).
226 #define __N(msgid) (msgid)
228 // For example, <windows.h> is known to #define min and max as macros...
232 // End of prewritten config; the discovered settings follow.