OSDN Git Service

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