]>
Commit | Line | Data |
---|---|---|
de53cb75 | 1 | // Predefined symbols and macros -*- C++ -*- |
725dc051 | 2 | |
94afef7b | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
1bc8b0ad | 4 | // Free Software Foundation, Inc. |
725dc051 BK |
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 | |
83f51799 | 19 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
725dc051 BK |
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 | ||
3d7c150e BK |
31 | #ifndef _CXXCONFIG |
32 | #define _CXXCONFIG 1 | |
725dc051 | 33 | |
79b425c6 PE |
34 | // Pick up any OS-specific definitions. |
35 | #include <bits/os_defines.h> | |
36 | ||
4b90c838 PC |
37 | // Pick up any CPU-specific definitions. |
38 | #include <bits/cpu_defines.h> | |
39 | ||
3cbc7af0 BK |
40 | // The current version of the C++ library in compressed ISO date format. |
41 | #define __GLIBCXX__ | |
285b36d6 | 42 | |
3cbc7af0 BK |
43 | // Macros for various namespace association schemes and modes. |
44 | #ifdef _GLIBCXX_DEBUG | |
45 | # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1 | |
46 | #endif | |
47 | ||
48 | #define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION | |
49 | ||
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 | |
71 | ||
72 | // Namespace associations for versioning mode. | |
73 | #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION | |
74 | namespace std | |
75 | { | |
76 | namespace _6 { } | |
77 | using namespace _6 __attribute__ ((strong)); | |
78 | } | |
79 | ||
80 | // In addition, other supported namespace configurations. | |
81 | namespace __gnu_cxx | |
285b36d6 | 82 | { |
3cbc7af0 BK |
83 | namespace _6 { } |
84 | using namespace _6 __attribute__ ((strong)); | |
285b36d6 BK |
85 | } |
86 | ||
3cbc7af0 | 87 | namespace __gnu_ext |
390e4c0d | 88 | { |
3cbc7af0 BK |
89 | namespace _6 { } |
90 | using namespace _6 __attribute__ ((strong)); | |
390e4c0d | 91 | } |
3cbc7af0 | 92 | |
285b36d6 BK |
93 | namespace std |
94 | { | |
3cbc7af0 BK |
95 | namespace tr1 |
96 | { | |
97 | namespace _6 { } | |
98 | using namespace _6 __attribute__ ((strong)); | |
99 | } | |
100 | } | |
101 | #endif | |
102 | ||
103 | // Namespace associations for debug mode. | |
104 | #if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG | |
105 | namespace std | |
106 | { | |
107 | namespace __gnu_norm { } | |
108 | ||
109 | #if 1 | |
110 | namespace __gnu_debug_def { } | |
111 | namespace __gnu_debug { using namespace __gnu_debug_def; } | |
285b36d6 | 112 | using namespace __gnu_debug_def __attribute__ ((strong)); |
3cbc7af0 BK |
113 | #else |
114 | namespace __gnu_debug { namespace detail { } } | |
115 | using namespace __gnu_debug __attribute__ ((strong)); | |
116 | #endif | |
390e4c0d | 117 | } |
3cbc7af0 BK |
118 | |
119 | # define _GLIBCXX_STD __gnu_norm | |
120 | # define _GLIBCXX_EXTERN_TEMPLATE 0 | |
451e92db BK |
121 | # if __NO_INLINE__ && !__GXX_WEAK__ |
122 | # warning debug mode without inlining may fail due to lack of weak symbols | |
94afef7b | 123 | # endif |
285b36d6 | 124 | #else |
3cbc7af0 BK |
125 | #if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION |
126 | # define _GLIBCXX_STD _6 | |
127 | #else | |
390e4c0d | 128 | # define _GLIBCXX_STD std |
285b36d6 | 129 | #endif |
3cbc7af0 BK |
130 | #endif |
131 | ||
390e4c0d | 132 | |
94afef7b BK |
133 | // Allow use of "export template." This is currently not a feature |
134 | // that g++ supports. | |
135 | // #define _GLIBCXX_EXPORT_TEMPLATE 1 | |
136 | ||
137 | // Allow use of the GNU syntax extension, "extern template." This | |
138 | // extension is fully documented in the g++ manual, but in a nutshell, | |
139 | // it inhibits all implicit instantiations and is used throughout the | |
140 | // library to avoid multiple weak definitions for required types that | |
141 | // are already explicitly instantiated in the library binary. This | |
142 | // substantially reduces the binary size of resulting executables. | |
143 | #ifndef _GLIBCXX_EXTERN_TEMPLATE | |
144 | # define _GLIBCXX_EXTERN_TEMPLATE 1 | |
145 | #endif | |
146 | ||
3cbc7af0 | 147 | |
94afef7b BK |
148 | // Certain function definitions that are meant to be overridable from |
149 | // user code are decorated with this macro. For some targets, this | |
150 | // macro causes these definitions to be weak. | |
151 | #ifndef _GLIBCXX_WEAK_DEFINITION | |
152 | # define _GLIBCXX_WEAK_DEFINITION | |
153 | #endif | |
725dc051 | 154 | |
1051c718 PE |
155 | // The remainder of the prewritten config is automatic; all the |
156 | // user hooks are listed above. | |
157 | ||
442c0874 JQ |
158 | // Create a boolean flag to be used to determine if --fast-math is set. |
159 | #ifdef __FAST_MATH__ | |
3d7c150e | 160 | # define _GLIBCXX_FAST_MATH 1 |
442c0874 | 161 | #else |
3d7c150e | 162 | # define _GLIBCXX_FAST_MATH 0 |
442c0874 JQ |
163 | #endif |
164 | ||
ad414290 PE |
165 | // This marks string literals in header files to be extracted for eventual |
166 | // translation. It is primarily used for messages in thrown exceptions; see | |
167 | // src/functexcept.cc. We use __N because the more traditional _N is used | |
168 | // for something else under certain OSes (see BADNAMES). | |
169 | #define __N(msgid) (msgid) | |
170 | ||
1051c718 | 171 | // End of prewritten config; the discovered settings follow. |