OSDN Git Service

2007-05-31 Paolo Carlini <pcarlini@suse.de>
[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 // Macro used to indicate that the native "C" includes, when compiled
49 // as "C++", have declarations in namespace std and not the global
50 // namespace. Note, this is unrelated to possible "C" compatibility
51 // includes that inject C90/C99 names into the global namespace.
52 // XXX May not be necessary
53 #if __cplusplus == 199711L
54 # define _GLIBCXX_NAMESPACE_GLOBAL_INJECTION 1
55 #endif
56
57 // Macros for visibility.
58 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
59
60 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
61 # define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
62 #else
63 # define _GLIBCXX_VISIBILITY(V) 
64 #endif
65
66 // Macros for controlling various namespace association schemes and modes.
67 // _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
68 // _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
69 // _GLIBCXX_NAMESPACE_ASSOCIATION_CXX200x
70 #ifdef _GLIBCXX_DEBUG
71 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
72 #endif
73
74 #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
75
76 // Macros for namespace scope.
77 // _GLIBCXX_BEGIN_NAMESPACE
78 // _GLIBCXX_END_NAMESPACE
79 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
80 // _GLIBCXX_END_NESTED_NAMESPACE
81 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
82 # define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)  namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
83 # define _GLIBCXX_END_NESTED_NAMESPACE } }
84 # define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
85 # define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
86 #else
87 # define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) { 
88 # define _GLIBCXX_END_NAMESPACE } 
89 # if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
90 #  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
91 #  define _GLIBCXX_END_NESTED_NAMESPACE  } }
92 # else
93 #  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
94 #  define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
95 # endif
96 #endif
97
98 // Namespace associations for versioning mode.
99 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
100 namespace std
101 {
102   namespace _6 { }
103   using namespace _6 __attribute__ ((strong));
104 }
105
106 namespace __gnu_cxx 
107
108   namespace _6 { }
109   using namespace _6 __attribute__ ((strong));
110 }
111
112 namespace std
113 {
114   namespace tr1 
115   { 
116     namespace _6 { }
117     using namespace _6 __attribute__ ((strong));
118   }
119 }
120 #endif
121
122 // Namespace associations for debug mode.
123 #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
124 namespace std
125
126   namespace __norm { }
127   namespace __debug { }
128   using namespace __debug __attribute__ ((strong)); 
129 }
130
131 namespace __gnu_cxx
132 {
133   namespace __norm { }
134   namespace __debug { }
135   using namespace __debug __attribute__ ((strong)); 
136 }
137
138 # define _GLIBCXX_STD __norm
139 # define _GLIBCXX_EXT __norm
140 # define _GLIBCXX_EXTERN_TEMPLATE 0
141 # if __NO_INLINE__ && !__GXX_WEAK__
142 #  warning debug mode without inlining may fail due to lack of weak symbols
143 # endif
144 #else
145 #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
146 # define _GLIBCXX_STD _6
147 # define _GLIBCXX_EXT _6
148 #else
149 # define _GLIBCXX_STD std
150 # define _GLIBCXX_EXT __gnu_cxx
151 #endif
152 #endif
153
154 // Define if compatibility should be provided for -mlong-double-64.
155 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
156
157 // XXX GLIBCXX_ABI Deprecated
158 // Namespace associations for long double 128 mode.
159 _GLIBCXX_BEGIN_NAMESPACE(std)
160 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
161 # define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
162 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
163 # define _GLIBCXX_END_LDBL_NAMESPACE }
164   namespace __gnu_cxx_ldbl128 { }
165   using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
166 #else
167 # define _GLIBCXX_LDBL_NAMESPACE
168 # define _GLIBCXX_BEGIN_LDBL_NAMESPACE
169 # define _GLIBCXX_END_LDBL_NAMESPACE
170 #endif
171 _GLIBCXX_END_NAMESPACE
172
173
174 // Allow use of "export template." This is currently not a feature
175 // that g++ supports.
176 // #define _GLIBCXX_EXPORT_TEMPLATE 1
177
178 // Allow use of the GNU syntax extension, "extern template." This
179 // extension is fully documented in the g++ manual, but in a nutshell,
180 // it inhibits all implicit instantiations and is used throughout the
181 // library to avoid multiple weak definitions for required types that
182 // are already explicitly instantiated in the library binary. This
183 // substantially reduces the binary size of resulting executables.
184 #ifndef _GLIBCXX_EXTERN_TEMPLATE
185 # define _GLIBCXX_EXTERN_TEMPLATE 1
186 #endif
187
188
189 // Certain function definitions that are meant to be overridable from
190 // user code are decorated with this macro.  For some targets, this
191 // macro causes these definitions to be weak.
192 #ifndef _GLIBCXX_WEAK_DEFINITION
193 # define _GLIBCXX_WEAK_DEFINITION
194 #endif
195
196 // The remainder of the prewritten config is automatic; all the
197 // user hooks are listed above.
198
199 // Create a boolean flag to be used to determine if --fast-math is set.
200 #ifdef __FAST_MATH__
201 # define _GLIBCXX_FAST_MATH 1
202 #else
203 # define _GLIBCXX_FAST_MATH 0
204 #endif
205
206 // This marks string literals in header files to be extracted for eventual
207 // translation.  It is primarily used for messages in thrown exceptions; see
208 // src/functexcept.cc.  We use __N because the more traditional _N is used
209 // for something else under certain OSes (see BADNAMES).
210 #define __N(msgid)     (msgid)
211
212 // For example, <windows.h> is known to #define min and max as macros...
213 #undef min
214 #undef max
215
216 // End of prewritten config; the discovered settings follow.