Merge from mainline
[official-gcc.git] / libstdc++-v3 / include / bits / c++config
bloba6a154a8cbe9d5dc1c0e67660f80201c24982a0c
1 // Predefined symbols and macros -*- C++ -*-
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
4 // 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.
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.
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.
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.
31 #ifndef _CXXCONFIG
32 #define _CXXCONFIG 1
34 // Pick up any OS-specific definitions.
35 #include <bits/os_defines.h>
37 // Pick up any CPU-specific definitions.
38 #include <bits/cpu_defines.h>
40 // The current version of the C++ library in compressed ISO date format.
41 #define __GLIBCXX__ 
43 // Macros for various namespace association schemes and modes.
44 #ifdef _GLIBCXX_DEBUG
45 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
46 #endif
48 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
50 // Macros for namespaces.
51 // _GLIBCXX_BEGIN_NAMESPACE
52 // _GLIBCXX_END_NAMESPACE
53 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
54 // _GLIBCXX_END_NESTED_NAMESPACE
55 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
56 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y {
57 # define _GLIBCXX_END_NESTED_NAMESPACE } }
58 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
59 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
60 #else
61 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X { 
62 # define _GLIBCXX_END_NAMESPACE } 
63 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
64 #  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y {
65 #  define _GLIBCXX_END_NESTED_NAMESPACE  } }
66 # else
67 #  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
68 #  define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
69 # endif
70 #endif
72 // Namespace associations for versioning mode.
73 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
74 namespace std
76   namespace _6 { }
77   using namespace _6 __attribute__ ((strong));
80 // In addition, other supported namespace configurations.
81 namespace __gnu_cxx 
82
83   namespace _6 { }
84   using namespace _6 __attribute__ ((strong));
87 namespace __gnu_ext
88
89   namespace _6 { }
90   using namespace _6 __attribute__ ((strong));
93 namespace std
95   namespace tr1 
96   { 
97     namespace _6 { }
98     using namespace _6 __attribute__ ((strong));
99   }
101 #endif
103 // Namespace associations for debug mode.
104 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
105 namespace std
107   namespace __gnu_norm { }
109 #if 1
110   namespace __gnu_debug_def { }
111   namespace __gnu_debug { using namespace __gnu_debug_def; } 
112   using namespace __gnu_debug_def __attribute__ ((strong));
113 #else
114   namespace __gnu_debug { namespace detail { } }
115   using namespace __gnu_debug __attribute__ ((strong));
116 #endif
119 # define _GLIBCXX_STD __gnu_norm
120 # define _GLIBCXX_EXTERN_TEMPLATE 0
121 # if __NO_INLINE__ && !__GXX_WEAK__
122 #  warning debug mode without inlining may fail due to lack of weak symbols
123 # endif
124 #else
125 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
126 # define _GLIBCXX_STD _6
127 #else
128 # define _GLIBCXX_STD std
129 #endif
130 #endif
132 /* Define if compatibility should be provided for -mlong-double-64. */
133 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
135 // XXX GLIBCXX_ABI Deprecated
136 // Namespace associations for long double 128 mode.
137 _GLIBCXX_BEGIN_NAMESPACE(std)
138 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
139 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
140 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
141 # define _GLIBCXX_END_LDBL_NAMESPACE }
142   namespace __gnu_cxx_ldbl128 { }
143   using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
144 #else
145 # define _GLIBCXX_LDBL_NAMESPACE
146 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
147 # define _GLIBCXX_END_LDBL_NAMESPACE
148 #endif
149 _GLIBCXX_END_NAMESPACE
151 // Allow use of "export template." This is currently not a feature
152 // that g++ supports.
153 // #define _GLIBCXX_EXPORT_TEMPLATE 1
155 // Allow use of the GNU syntax extension, "extern template." This
156 // extension is fully documented in the g++ manual, but in a nutshell,
157 // it inhibits all implicit instantiations and is used throughout the
158 // library to avoid multiple weak definitions for required types that
159 // are already explicitly instantiated in the library binary. This
160 // substantially reduces the binary size of resulting executables.
161 #ifndef _GLIBCXX_EXTERN_TEMPLATE
162 # define _GLIBCXX_EXTERN_TEMPLATE 1
163 #endif
166 // Certain function definitions that are meant to be overridable from
167 // user code are decorated with this macro.  For some targets, this
168 // macro causes these definitions to be weak.
169 #ifndef _GLIBCXX_WEAK_DEFINITION
170 # define _GLIBCXX_WEAK_DEFINITION
171 #endif
173 // The remainder of the prewritten config is automatic; all the
174 // user hooks are listed above.
176 // Create a boolean flag to be used to determine if --fast-math is set.
177 #ifdef __FAST_MATH__
178 # define _GLIBCXX_FAST_MATH 1
179 #else
180 # define _GLIBCXX_FAST_MATH 0
181 #endif
183 // This marks string literals in header files to be extracted for eventual
184 // translation.  It is primarily used for messages in thrown exceptions; see
185 // src/functexcept.cc.  We use __N because the more traditional _N is used
186 // for something else under certain OSes (see BADNAMES).
187 #define __N(msgid)     (msgid)
189 // End of prewritten config; the discovered settings follow.