]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/bits/c++config
c++config: Consistent macro guards for config includes.
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / c++config
1 // Predefined symbols and macros -*- C++ -*-
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007 Free Software Foundation, Inc.
5 //
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)
10 // any later version.
11
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.
16
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,
20 // USA.
21
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.
30
31 /** @file c++config.h
32 * This is an internal header file, included by other library headers.
33 * You should not attempt to use it directly.
34 */
35
36 #ifndef _GLIBCXX_CXX_CONFIG_H
37 #define _GLIBCXX_CXX_CONFIG_H 1
38
39 // Pick up any OS-specific definitions.
40 #include <bits/os_defines.h>
41
42 // Pick up any CPU-specific definitions.
43 #include <bits/cpu_defines.h>
44
45 // The current version of the C++ library in compressed ISO date format.
46 #define __GLIBCXX__
47
48 // Macros for visibility.
49 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
50
51 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
52 #define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
53 #else
54 #define _GLIBCXX_VISIBILITY(V)
55 #endif
56
57 // Macros for controlling various namespace association schemes and modes.
58 #ifdef _GLIBCXX_DEBUG
59 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
60 #endif
61
62 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
63
64 // Macros for namespace scope.
65 // _GLIBCXX_BEGIN_NAMESPACE
66 // _GLIBCXX_END_NAMESPACE
67 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
68 // _GLIBCXX_END_NESTED_NAMESPACE
69 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
70 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
71 # define _GLIBCXX_END_NESTED_NAMESPACE } }
72 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
73 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
74 #else
75 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
76 # define _GLIBCXX_END_NAMESPACE }
77 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
78 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
79 # define _GLIBCXX_END_NESTED_NAMESPACE } }
80 # else
81 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
82 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
83 # endif
84 #endif
85
86 // Namespace associations for versioning mode.
87 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
88 namespace std
89 {
90 namespace _6 { }
91 using namespace _6 __attribute__ ((strong));
92 }
93
94 // In addition, other supported namespace configurations.
95 namespace __gnu_cxx
96 {
97 namespace _6 { }
98 using namespace _6 __attribute__ ((strong));
99 }
100
101 namespace std
102 {
103 namespace tr1
104 {
105 namespace _6 { }
106 using namespace _6 __attribute__ ((strong));
107 }
108 }
109 #endif
110
111 // Namespace associations for debug mode.
112 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
113 namespace std
114 {
115 namespace __norm { }
116 namespace __debug { }
117 using namespace __debug __attribute__ ((strong));
118 }
119
120 namespace __gnu_cxx
121 {
122 namespace __norm { }
123 namespace __debug { }
124 using namespace __debug __attribute__ ((strong));
125 }
126
127 # define _GLIBCXX_STD __norm
128 # define _GLIBCXX_EXT __norm
129 # define _GLIBCXX_EXTERN_TEMPLATE 0
130 # if __NO_INLINE__ && !__GXX_WEAK__
131 # warning debug mode without inlining may fail due to lack of weak symbols
132 # endif
133 #else
134 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
135 # define _GLIBCXX_STD _6
136 # define _GLIBCXX_EXT _6
137 #else
138 # define _GLIBCXX_STD std
139 # define _GLIBCXX_EXT __gnu_cxx
140 #endif
141 #endif
142
143 /* Define if compatibility should be provided for -mlong-double-64. */
144 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
145
146 // XXX GLIBCXX_ABI Deprecated
147 // Namespace associations for long double 128 mode.
148 _GLIBCXX_BEGIN_NAMESPACE(std)
149 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
150 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
151 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
152 # define _GLIBCXX_END_LDBL_NAMESPACE }
153 namespace __gnu_cxx_ldbl128 { }
154 using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
155 #else
156 # define _GLIBCXX_LDBL_NAMESPACE
157 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
158 # define _GLIBCXX_END_LDBL_NAMESPACE
159 #endif
160 _GLIBCXX_END_NAMESPACE
161
162
163 // Allow use of "export template." This is currently not a feature
164 // that g++ supports.
165 // #define _GLIBCXX_EXPORT_TEMPLATE 1
166
167 // Allow use of the GNU syntax extension, "extern template." This
168 // extension is fully documented in the g++ manual, but in a nutshell,
169 // it inhibits all implicit instantiations and is used throughout the
170 // library to avoid multiple weak definitions for required types that
171 // are already explicitly instantiated in the library binary. This
172 // substantially reduces the binary size of resulting executables.
173 #ifndef _GLIBCXX_EXTERN_TEMPLATE
174 # define _GLIBCXX_EXTERN_TEMPLATE 1
175 #endif
176
177
178 // Certain function definitions that are meant to be overridable from
179 // user code are decorated with this macro. For some targets, this
180 // macro causes these definitions to be weak.
181 #ifndef _GLIBCXX_WEAK_DEFINITION
182 # define _GLIBCXX_WEAK_DEFINITION
183 #endif
184
185 // The remainder of the prewritten config is automatic; all the
186 // user hooks are listed above.
187
188 // Create a boolean flag to be used to determine if --fast-math is set.
189 #ifdef __FAST_MATH__
190 # define _GLIBCXX_FAST_MATH 1
191 #else
192 # define _GLIBCXX_FAST_MATH 0
193 #endif
194
195 // This marks string literals in header files to be extracted for eventual
196 // translation. It is primarily used for messages in thrown exceptions; see
197 // src/functexcept.cc. We use __N because the more traditional _N is used
198 // for something else under certain OSes (see BADNAMES).
199 #define __N(msgid) (msgid)
200
201 // For example, <windows.h> is known to #define min and max as macros...
202 #undef min
203 #undef max
204
205 // End of prewritten config; the discovered settings follow.