]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.6/include/bits/c++config
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.6 / 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, 2009, 2010, 2011 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 3, 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 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /** @file bits/c++config.h
27  *  This is an internal header file, included by other library headers.
28  *  Do not attempt to use it directly. @headername{iosfwd}
29  */
30
31 #ifndef _GLIBCXX_CXX_CONFIG_H
32 #define _GLIBCXX_CXX_CONFIG_H 1
33
34 // The current version of the C++ library in compressed ISO date format.
35 #define __GLIBCXX__
36
37 // Macros for various attributes.
38 //   _GLIBCXX_PURE
39 //   _GLIBCXX_CONST
40 //   _GLIBCXX_NORETURN
41 //   _GLIBCXX_NOTHROW
42 //   _GLIBCXX_VISIBILITY
43 #ifndef _GLIBCXX_PURE
44 # define _GLIBCXX_PURE __attribute__ ((__pure__))
45 #endif
46
47 #ifndef _GLIBCXX_CONST
48 # define _GLIBCXX_CONST __attribute__ ((__const__))
49 #endif
50
51 #ifndef _GLIBCXX_NORETURN
52 # define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
53 #endif
54
55 #ifndef _GLIBCXX_NOTHROW
56 # ifdef __cplusplus
57 #  define _GLIBCXX_NOTHROW throw()
58 # else
59 #  define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
60 # endif
61 #endif
62
63 // Macros for visibility attributes.
64 //   _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
65 //   _GLIBCXX_VISIBILITY
66 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
67
68 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
69 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
70 #else
71 // If this is not supplied by the OS-specific or CPU-specific
72 // headers included below, it will be defined to an empty default.
73 # define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
74 #endif
75
76 // Macros for deprecated attributes.
77 //   _GLIBCXX_USE_DEPRECATED
78 //   _GLIBCXX_DEPRECATED
79 #ifndef _GLIBCXX_USE_DEPRECATED
80 # define _GLIBCXX_USE_DEPRECATED 1
81 #endif
82
83 #if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
84 # define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
85 #else
86 # define _GLIBCXX_DEPRECATED
87 #endif
88
89 #if __cplusplus
90
91 // Macro for constexpr, to support in mixed 03/0x mode.
92 #ifndef _GLIBCXX_CONSTEXPR
93 # ifdef __GXX_EXPERIMENTAL_CXX0X__
94 #  define _GLIBCXX_CONSTEXPR constexpr
95 #  define _GLIBCXX_USE_CONSTEXPR constexpr
96 # else
97 #  define _GLIBCXX_CONSTEXPR
98 #  define _GLIBCXX_USE_CONSTEXPR const
99 # endif
100 #endif
101
102 // Macro for extern template, ie controling template linkage via use
103 // of extern keyword on template declaration. As documented in the g++
104 // manual, it inhibits all implicit instantiations and is used
105 // throughout the library to avoid multiple weak definitions for
106 // required types that are already explicitly instantiated in the
107 // library binary. This substantially reduces the binary size of
108 // resulting executables.
109 // Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
110 // templates only in basic_string, thus activating its debug-mode
111 // checks even at -O0.
112 #define _GLIBCXX_EXTERN_TEMPLATE
113
114 /*
115   Outline of libstdc++ namespaces.
116
117   namespace std
118   {
119     namespace __debug { }
120     namespace __parallel { }
121     namespace __profile { }
122     namespace __cxx1998 { }
123
124     namespace __detail { }
125
126     namespace rel_ops { }
127
128     namespace tr1
129     {
130       namespace placeholders { }
131       namespace regex_constants { }
132       namespace __detail { }
133     }
134
135     namespace decimal { }
136
137     namespace chrono { }
138     namespace placeholders { }
139     namespace regex_constants { }
140     namespace this_thread { }
141   }
142
143   namespace abi { }
144
145   namespace __gnu_cxx
146   {
147     namespace __detail { }
148   }
149
150   For full details see:
151   http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html
152 */
153 namespace std
154 {
155   typedef __SIZE_TYPE__         size_t;
156   typedef __PTRDIFF_TYPE__      ptrdiff_t;
157
158 #ifdef __GXX_EXPERIMENTAL_CXX0X__
159   typedef decltype(nullptr)     nullptr_t;
160 #endif
161 }
162
163
164 // Defined if inline namespaces are used for versioning.
165 #define _GLIBCXX_INLINE_VERSION 
166
167 // Inline namespace for symbol versioning.
168 #if _GLIBCXX_INLINE_VERSION
169
170 namespace std
171 {
172   inline namespace __7 { }
173
174   namespace rel_ops { inline namespace __7 { } }
175
176   namespace tr1
177   {
178     inline namespace __7 { }
179     namespace placeholders { inline namespace __7 { } }
180     namespace regex_constants { inline namespace __7 { } }
181     namespace __detail { inline namespace __7 { } }
182   }
183
184   namespace decimal { inline namespace __7 { } }
185
186   namespace chrono { inline namespace __7 { } }
187   namespace placeholders { inline namespace __7 { } }
188   namespace regex_constants { inline namespace __7 { } }
189   namespace this_thread { inline namespace __7 { } }
190
191   namespace __detail { inline namespace __7 { } }
192   namespace __regex { inline namespace __7 { } }
193 }
194
195 namespace __gnu_cxx
196 {
197   inline namespace __7 { }
198   namespace __detail { inline namespace __7 { } }
199 }
200 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __7 {
201 # define _GLIBCXX_END_NAMESPACE_VERSION }
202 #else
203 # define _GLIBCXX_BEGIN_NAMESPACE_VERSION
204 # define _GLIBCXX_END_NAMESPACE_VERSION
205 #endif
206
207
208 // Inline namespaces for special modes: debug, parallel, profile.
209 #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \
210     || defined(_GLIBCXX_PROFILE)
211 namespace std
212 {
213   // Non-inline namespace for components replaced by alternates in active mode.
214   namespace __cxx1998
215   {
216 #if _GLIBCXX_INLINE_VERSION
217  inline namespace __7 { }
218 #endif
219   }
220
221   // Inline namespace for debug mode.
222 # ifdef _GLIBCXX_DEBUG
223   inline namespace __debug { }
224 # endif
225
226   // Inline namespaces for parallel mode.
227 # ifdef _GLIBCXX_PARALLEL
228   inline namespace __parallel { }
229 # endif
230
231   // Inline namespaces for profile mode
232 # ifdef _GLIBCXX_PROFILE
233   inline namespace __profile { }
234 # endif
235 }
236
237 // Check for invalid usage and unsupported mixed-mode use.
238 # if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL)
239 #  error illegal use of multiple inlined namespaces
240 # endif
241 # if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_DEBUG)
242 #  error illegal use of multiple inlined namespaces
243 # endif
244 # if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_PARALLEL)
245 #  error illegal use of multiple inlined namespaces
246 # endif
247
248 // Check for invalid use due to lack for weak symbols.
249 # if __NO_INLINE__ && !__GXX_WEAK__
250 #  warning currently using inlined namespace mode which may fail \
251    without inlining due to lack of weak symbols
252 # endif
253 #endif
254
255 // Macros for namespace scope. Either namespace std:: or the name
256 // of some nested namespace within it corresponding to the active mode.
257 // _GLIBCXX_STD_A
258 // _GLIBCXX_STD_C
259 //
260 // Macros for opening/closing conditional namespaces.
261 // _GLIBCXX_BEGIN_NAMESPACE_ALGO
262 // _GLIBCXX_END_NAMESPACE_ALGO
263 // _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
264 // _GLIBCXX_END_NAMESPACE_CONTAINER
265 #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
266 # define _GLIBCXX_STD_C __cxx1998
267 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
268          namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION
269 # define _GLIBCXX_END_NAMESPACE_CONTAINER \
270          } _GLIBCXX_END_NAMESPACE_VERSION
271 # undef _GLIBCXX_EXTERN_TEMPLATE
272 # define _GLIBCXX_EXTERN_TEMPLATE -1
273 #endif
274
275 #ifdef _GLIBCXX_PARALLEL
276 # define _GLIBCXX_STD_A __cxx1998
277 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO \
278          namespace _GLIBCXX_STD_A { _GLIBCXX_BEGIN_NAMESPACE_VERSION
279 # define _GLIBCXX_END_NAMESPACE_ALGO \
280          } _GLIBCXX_END_NAMESPACE_VERSION
281 #endif
282
283 #ifndef _GLIBCXX_STD_A
284 # define _GLIBCXX_STD_A std
285 #endif
286
287 #ifndef _GLIBCXX_STD_C
288 # define _GLIBCXX_STD_C std
289 #endif
290
291 #ifndef _GLIBCXX_BEGIN_NAMESPACE_ALGO
292 # define _GLIBCXX_BEGIN_NAMESPACE_ALGO
293 #endif
294
295 #ifndef _GLIBCXX_END_NAMESPACE_ALGO
296 # define _GLIBCXX_END_NAMESPACE_ALGO
297 #endif
298
299 #ifndef _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
300 # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
301 #endif
302
303 #ifndef _GLIBCXX_END_NAMESPACE_CONTAINER
304 # define _GLIBCXX_END_NAMESPACE_CONTAINER
305 #endif
306
307 // GLIBCXX_ABI Deprecated
308 // Define if compatibility should be provided for -mlong-double-64.
309 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
310
311 // Inline namespace for long double 128 mode.
312 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
313 namespace std
314 {
315   inline namespace __gnu_cxx_ldbl128 { }
316 }
317 # define _GLIBCXX_NAMESPACE_LDBL __gnu_cxx_ldbl128::
318 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL namespace __gnu_cxx_ldbl128 {
319 # define _GLIBCXX_END_NAMESPACE_LDBL }
320 #else
321 # define _GLIBCXX_NAMESPACE_LDBL
322 # define _GLIBCXX_BEGIN_NAMESPACE_LDBL
323 # define _GLIBCXX_END_NAMESPACE_LDBL
324 #endif
325
326 // Assert.
327 #if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL)
328 # define __glibcxx_assert(_Condition)
329 #else
330 namespace std
331 {
332   // Avoid the use of assert, because we're trying to keep the <cassert>
333   // include out of the mix.
334   inline void
335   __replacement_assert(const char* __file, int __line,
336                        const char* __function, const char* __condition)
337   {
338     __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
339                      __function, __condition);
340     __builtin_abort();
341   }
342 }
343 #define __glibcxx_assert(_Condition)                                     \
344   do                                                                     \
345   {                                                                      \
346     if (! (_Condition))                                                  \
347       std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
348                                 #_Condition);                            \
349   } while (false)
350 #endif
351
352 // Macros for race detectors.
353 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and
354 // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain
355 // atomic (lock-free) synchronization to race detectors:
356 // the race detector will infer a happens-before arc from the former to the
357 // latter when they share the same argument pointer.
358 //
359 // The most frequent use case for these macros (and the only case in the
360 // current implementation of the library) is atomic reference counting:
361 //   void _M_remove_reference()
362 //   {
363 //     _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&this->_M_refcount);
364 //     if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount, -1) <= 0)
365 //       {
366 //         _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&this->_M_refcount);
367 //         _M_destroy(__a);
368 //       }
369 //   }
370 // The annotations in this example tell the race detector that all memory
371 // accesses occurred when the refcount was positive do not race with
372 // memory accesses which occurred after the refcount became zero.
373 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE
374 # define  _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A)
375 #endif
376 #ifndef _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER
377 # define  _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A)
378 #endif
379
380 // Macros for C linkage: define extern "C" linkage only when using C++.
381 # define _GLIBCXX_BEGIN_EXTERN_C extern "C" {
382 # define _GLIBCXX_END_EXTERN_C }
383
384 #else // !__cplusplus
385 # define _GLIBCXX_BEGIN_EXTERN_C
386 # define _GLIBCXX_END_EXTERN_C
387 #endif
388
389
390 // First includes.
391
392 // Pick up any OS-specific definitions.
393 #include <bits/os_defines.h>
394
395 // Pick up any CPU-specific definitions.
396 #include <bits/cpu_defines.h>
397
398 // If platform uses neither visibility nor psuedo-visibility,
399 // specify empty default for namespace annotation macros.
400 #ifndef _GLIBCXX_PSEUDO_VISIBILITY
401 # define _GLIBCXX_PSEUDO_VISIBILITY(V)
402 #endif
403
404 // Certain function definitions that are meant to be overridable from
405 // user code are decorated with this macro.  For some targets, this
406 // macro causes these definitions to be weak.
407 #ifndef _GLIBCXX_WEAK_DEFINITION
408 # define _GLIBCXX_WEAK_DEFINITION
409 #endif
410
411
412 // The remainder of the prewritten config is automatic; all the
413 // user hooks are listed above.
414
415 // Create a boolean flag to be used to determine if --fast-math is set.
416 #ifdef __FAST_MATH__
417 # define _GLIBCXX_FAST_MATH 1
418 #else
419 # define _GLIBCXX_FAST_MATH 0
420 #endif
421
422 // This marks string literals in header files to be extracted for eventual
423 // translation.  It is primarily used for messages in thrown exceptions; see
424 // src/functexcept.cc.  We use __N because the more traditional _N is used
425 // for something else under certain OSes (see BADNAMES).
426 #define __N(msgid)     (msgid)
427
428 // For example, <windows.h> is known to #define min and max as macros...
429 #undef min
430 #undef max
431
432 // End of prewritten config; the settings discovered at configure time follow.