OSDN Git Service

2008-04-28 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, 2008 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 // The current version of the C++ library in compressed ISO date format.
40 #define __GLIBCXX__ 
41
42 // Macros for visibility.
43 // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
44 // _GLIBCXX_VISIBILITY_ATTR
45 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
46
47 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
48 # define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V)))
49 #else
50 # define _GLIBCXX_VISIBILITY_ATTR(V) 
51 #endif
52
53 // Macros for deprecated.
54 // _GLIBCXX_DEPRECATED
55 // _GLIBCXX_DEPRECATED_ATTR
56 #ifndef _GLIBCXX_DEPRECATED
57 # define _GLIBCXX_DEPRECATED 1
58 #endif
59
60 #if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
61 # define _GLIBCXX_DEPRECATED_ATTR __attribute__ ((__deprecated__))
62 #else
63 # define _GLIBCXX_DEPRECATED_ATTR
64 #endif
65
66 // Macros for activating various namespace association modes.
67 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
68 // _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
69 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
70
71 // Guide to libstdc++ namespaces.
72 /*
73   namespace std
74   {
75     namespace __debug { }
76     namespace __parallel { }
77     namespace __norm { } // __normative, __shadow, __replaced
78     namespace __cxx1998 { }
79
80     namespace tr1 { }
81   }
82 */
83
84 #ifdef _GLIBCXX_DEBUG
85 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
86 #endif
87
88 #ifdef _GLIBCXX_PARALLEL
89 # define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
90 #endif
91
92 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
93
94 // Defined if any namespace association modes are active.
95 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
96   || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
97   || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
98 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
99 #endif
100
101 // Macros for namespace scope. Either namespace std:: or the name
102 // of some nested namespace within it.
103 // _GLIBCXX_STD
104 // _GLIBCXX_STD_D
105 // _GLIBCXX_STD_P
106
107 //
108 // Macros for enclosing namespaces 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_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
120 # define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
121 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
122 # define _GLIBCXX_END_NAMESPACE }
123 #else
124
125 # if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
126 #  define _GLIBCXX_STD_D _GLIBCXX_STD
127 #  define _GLIBCXX_STD_P _GLIBCXX_STD
128 #  define _GLIBCXX_STD _6
129 #  define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
130 #  define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
131 # endif
132
133 //  debug
134 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
135 #  define _GLIBCXX_STD_D __norm
136 #  define _GLIBCXX_STD_P _GLIBCXX_STD
137 #  define _GLIBCXX_STD __cxx1998
138 #  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
139 #  define _GLIBCXX_END_NAMESPACE }
140 #  define _GLIBCXX_EXTERN_TEMPLATE 0
141 # endif
142
143 // parallel
144 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 
145 #  define _GLIBCXX_STD_D _GLIBCXX_STD
146 #  define _GLIBCXX_STD_P __norm
147 #  define _GLIBCXX_STD __cxx1998
148 #  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
149 #  define _GLIBCXX_END_NAMESPACE }
150 #  define _GLIBCXX_EXTERN_TEMPLATE 0
151 # endif
152
153 // debug + parallel
154 # if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 
155 #  define _GLIBCXX_STD_D __norm
156 #  define _GLIBCXX_STD_P __norm
157 #  define _GLIBCXX_STD __cxx1998
158 #  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
159 #  define _GLIBCXX_END_NAMESPACE }
160 #  define _GLIBCXX_EXTERN_TEMPLATE 0
161 # endif
162
163 # if __NO_INLINE__ && !__GXX_WEAK__
164 #  warning currently using namespace associated mode which may fail \
165    without inlining due to lack of weak symbols
166 # endif
167
168 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)  namespace X { namespace Y _GLIBCXX_VISIBILITY_ATTR(default) {
169 # define _GLIBCXX_END_NESTED_NAMESPACE } }
170 #endif
171
172 // Namespace associations for debug mode.
173 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
174 namespace std
175
176   namespace __norm { } 
177   inline namespace __debug { }
178   inline namespace __cxx1998 { }
179 }
180 #endif
181
182 // Namespace associations for parallel mode.
183 #if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
184 namespace std
185
186   namespace __norm { } 
187   inline namespace __parallel { }
188   inline namespace __cxx1998 { }
189 }
190 #endif
191
192 // Namespace associations for versioning mode.
193 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
194 namespace std
195 {
196   inline namespace _6 { }
197 }
198
199 namespace __gnu_cxx 
200
201   inline namespace _6 { }
202 }
203
204 namespace std
205 {
206   namespace tr1 
207   { 
208     inline namespace _6 { }
209   }
210 }
211 #endif
212
213 // XXX GLIBCXX_ABI Deprecated
214 // Define if compatibility should be provided for -mlong-double-64
215 #if defined __cplusplus && defined __LONG_DOUBLE_128__ 
216 # undef _GLIBCXX_LONG_DOUBLE_COMPAT
217 #endif
218
219 // Namespace associations for long double 128 mode.
220 #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
221 namespace std
222 {
223   inline namespace __gnu_cxx_ldbl128 { }
224 }
225 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
226 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
227 # define _GLIBCXX_END_LDBL_NAMESPACE }
228 #else
229 # define _GLIBCXX_LDBL_NAMESPACE
230 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
231 # define _GLIBCXX_END_LDBL_NAMESPACE
232 #endif
233
234
235 // Defines for C compatibility. In particular, define extern "C"
236 // linkage only when using  C++, same with namespaces.
237 #if __cplusplus
238 # define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
239 # define _GLIBCXX_END_EXTERN_C }
240 #else
241 # define _GLIBCXX_BEGIN_EXTERN_C
242 # define _GLIBCXX_END_EXTERN_C
243 # undef _GLIBCXX_BEGIN_NAMESPACE
244 # undef _GLIBCXX_END_NAMESPACE
245 # define _GLIBCXX_BEGIN_NAMESPACE(X) 
246 # define _GLIBCXX_END_NAMESPACE 
247 #endif
248
249 // First includes.
250
251 // Pick up any OS-specific definitions.
252 #include <bits/os_defines.h>
253
254 // Pick up any CPU-specific definitions.
255 #include <bits/cpu_defines.h>
256
257 // Allow use of "export template." This is currently not a feature
258 // that g++ supports.
259 // #define _GLIBCXX_EXPORT_TEMPLATE 1
260
261 // Allow use of the GNU syntax extension, "extern template." This
262 // extension is fully documented in the g++ manual, but in a nutshell,
263 // it inhibits all implicit instantiations and is used throughout the
264 // library to avoid multiple weak definitions for required types that
265 // are already explicitly instantiated in the library binary. This
266 // substantially reduces the binary size of resulting executables.
267 #ifndef _GLIBCXX_EXTERN_TEMPLATE
268 # define _GLIBCXX_EXTERN_TEMPLATE 1
269 #endif
270
271 // Certain function definitions that are meant to be overridable from
272 // user code are decorated with this macro.  For some targets, this
273 // macro causes these definitions to be weak.
274 #ifndef _GLIBCXX_WEAK_DEFINITION
275 # define _GLIBCXX_WEAK_DEFINITION
276 #endif
277
278 // The remainder of the prewritten config is automatic; all the
279 // user hooks are listed above.
280
281 // Create a boolean flag to be used to determine if --fast-math is set.
282 #ifdef __FAST_MATH__
283 # define _GLIBCXX_FAST_MATH 1
284 #else
285 # define _GLIBCXX_FAST_MATH 0
286 #endif
287
288 // This marks string literals in header files to be extracted for eventual
289 // translation.  It is primarily used for messages in thrown exceptions; see
290 // src/functexcept.cc.  We use __N because the more traditional _N is used
291 // for something else under certain OSes (see BADNAMES).
292 #define __N(msgid)     (msgid)
293
294 // For example, <windows.h> is known to #define min and max as macros...
295 #undef min
296 #undef max
297
298 // End of prewritten config; the discovered settings follow.