OSDN Git Service

2007-10-18 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.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
70 // Macros for activating various namespace association modes.
71 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
72 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
73 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
74
75 #ifdef _GLIBCXX_DEBUG
76 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
77 #endif
78
79 #ifdef _GLIBCXX_PARALLEL
80 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
81 #endif
82
83 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
84
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
90 #endif
91
92 // Macros for namespace scope. Either namespace std:: or __gnu_cxx::,
93 // or the name of some nested namespace within it.
94 // _GLIBCXX_STD
95 // _GLIBCXX_STD_D
96 // _GLIBCXX_STD_P
97
98 //
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 }
114 #else
115
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
122 # endif
123
124 //  debug
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
132 # endif
133
134 // parallel
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
142 # endif
143
144 // debug + parallel
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
152 # endif
153
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
157 # endif
158
159 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)  namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
160 # define _GLIBCXX_END_NESTED_NAMESPACE } }
161 #endif
162
163 // Namespace associations for debug mode.
164 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
165 namespace std
166
167   namespace __norm { } 
168   namespace __debug { }
169   namespace __cxx1998 { }
170
171   using namespace __debug __attribute__ ((strong)); 
172   using namespace __cxx1998 __attribute__ ((strong)); 
173 }
174 #endif
175
176 // Namespace associations for parallel mode.
177 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
178 namespace std
179
180   namespace __norm { } 
181   namespace __parallel { }
182   namespace __cxx1998 { }
183
184   using namespace __parallel __attribute__ ((strong));
185   using namespace __cxx1998 __attribute__ ((strong)); 
186 }
187 #endif
188
189 // Namespace associations for versioning mode.
190 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
191 namespace std
192 {
193   namespace _6 { }
194   using namespace _6 __attribute__ ((strong));
195 }
196
197 namespace __gnu_cxx 
198
199   namespace _6 { }
200   using namespace _6 __attribute__ ((strong));
201 }
202
203 namespace std
204 {
205   namespace tr1 
206   { 
207     namespace _6 { }
208     using namespace _6 __attribute__ ((strong));
209   }
210 }
211 #endif
212
213 // Define if compatibility should be provided for -mlong-double-64.
214 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
215
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__));
225 #else
226 # define _GLIBCXX_LDBL_NAMESPACE
227 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
228 # define _GLIBCXX_END_LDBL_NAMESPACE
229 #endif
230 _GLIBCXX_END_NAMESPACE
231
232
233 // Allow use of "export template." This is currently not a feature
234 // that g++ supports.
235 // #define _GLIBCXX_EXPORT_TEMPLATE 1
236
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
245 #endif
246
247
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
253 #endif
254
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
261 #endif
262
263 // The remainder of the prewritten config is automatic; all the
264 // user hooks are listed above.
265
266 // Create a boolean flag to be used to determine if --fast-math is set.
267 #ifdef __FAST_MATH__
268 # define _GLIBCXX_FAST_MATH 1
269 #else
270 # define _GLIBCXX_FAST_MATH 0
271 #endif
272
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)
278
279 // For example, <windows.h> is known to #define min and max as macros...
280 #undef min
281 #undef max
282
283 // End of prewritten config; the discovered settings follow.