]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/bits/c++config
Add parallel mode.
[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 support.
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 // Guide to libstdc++ namespaces.
58 /*
59 namespace std
60 {
61 namespace __debug { }
62 namespace __parallel { }
63 namespace __norm { } // __normative, __shadow, __replaced
64 namespace __cxx1998 { }
65
66 namespace tr1 { }
67 }
68
69 namespace __gnu_cxx
70 {
71 namespace __debug { }
72 namespace __norm { }
73 }
74 */
75
76 // Macros for activating various namespace association modes.
77 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
78 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
79 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
80
81 #ifdef _GLIBCXX_DEBUG
82 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
83 #endif
84
85 #ifdef _GLIBCXX_PARALLEL
86 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
87 #endif
88
89 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
90
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
96 #endif
97
98 // Macros for namespace scope. Either namespace std:: or __gnu_cxx::,
99 // or the name of some nested namespace within it.
100 // _GLIBCXX_STD
101 // _GLIBCXX_STD_D
102 // _GLIBCXX_STD_P
103 // _GLIBCXX_EXT
104 // _GLIBCXX_EXT_D
105 // _GLIBCXX_EXT_P
106
107 //
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 }
126 #else
127
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
135 # endif
136
137 // debug
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
148 # endif
149
150 // parallel
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
161 # endif
162
163 // debug + parallel
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
174 # endif
175
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
179 # endif
180
181 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
182 # define _GLIBCXX_END_NESTED_NAMESPACE } }
183 #endif
184
185 // Namespace associations for debug mode.
186 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
187 namespace std
188 {
189 namespace __norm { }
190 namespace __debug { }
191 namespace __cxx1998 { }
192
193 using namespace __debug __attribute__ ((strong));
194 using namespace __cxx1998 __attribute__ ((strong));
195 }
196
197 namespace __gnu_cxx
198 {
199 namespace __norm { }
200 namespace __debug { }
201 namespace __cxx1998 { }
202
203 using namespace __debug __attribute__ ((strong));
204 using namespace __cxx1998 __attribute__ ((strong));
205 }
206 #endif
207
208 // Namespace associations for parallel mode.
209 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
210 namespace std
211 {
212 namespace __norm { }
213 namespace __parallel { }
214 namespace __cxx1998 { }
215
216 using namespace __parallel __attribute__ ((strong));
217 using namespace __cxx1998 __attribute__ ((strong));
218 }
219
220 namespace __gnu_cxx
221 {
222 namespace __norm { }
223 namespace __parallel { }
224 namespace __cxx1998 { }
225
226 using namespace __parallel __attribute__ ((strong));
227 using namespace __cxx1998 __attribute__ ((strong));
228 }
229 #endif
230
231 // Namespace associations for versioning mode.
232 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
233 namespace std
234 {
235 namespace _6 { }
236 using namespace _6 __attribute__ ((strong));
237 }
238
239 namespace __gnu_cxx
240 {
241 namespace _6 { }
242 using namespace _6 __attribute__ ((strong));
243 }
244
245 namespace std
246 {
247 namespace tr1
248 {
249 namespace _6 { }
250 using namespace _6 __attribute__ ((strong));
251 }
252 }
253 #endif
254
255 // Define if compatibility should be provided for -mlong-double-64.
256 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
257
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__));
267 #else
268 # define _GLIBCXX_LDBL_NAMESPACE
269 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
270 # define _GLIBCXX_END_LDBL_NAMESPACE
271 #endif
272 _GLIBCXX_END_NAMESPACE
273
274
275 // Allow use of "export template." This is currently not a feature
276 // that g++ supports.
277 // #define _GLIBCXX_EXPORT_TEMPLATE 1
278
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
287 #endif
288
289
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
295 #endif
296
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
303 #endif
304
305 // The remainder of the prewritten config is automatic; all the
306 // user hooks are listed above.
307
308 // Create a boolean flag to be used to determine if --fast-math is set.
309 #ifdef __FAST_MATH__
310 # define _GLIBCXX_FAST_MATH 1
311 #else
312 # define _GLIBCXX_FAST_MATH 0
313 #endif
314
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)
320
321 // For example, <windows.h> is known to #define min and max as macros...
322 #undef min
323 #undef max
324
325 // End of prewritten config; the discovered settings follow.