c++config revision 169691
197403Sobrien// Predefined symbols and macros -*- C++ -*-
297403Sobrien
397403Sobrien// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
497403Sobrien// 2006, 2007
597403Sobrien// Free Software Foundation, Inc.
697403Sobrien//
797403Sobrien// This file is part of the GNU ISO C++ Library.  This library is free
897403Sobrien// software; you can redistribute it and/or modify it under the
997403Sobrien// terms of the GNU General Public License as published by the
1097403Sobrien// Free Software Foundation; either version 2, or (at your option)
1197403Sobrien// any later version.
1297403Sobrien
1397403Sobrien// This library is distributed in the hope that it will be useful,
1497403Sobrien// but WITHOUT ANY WARRANTY; without even the implied warranty of
1597403Sobrien// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1697403Sobrien// GNU General Public License for more details.
1797403Sobrien
1897403Sobrien// You should have received a copy of the GNU General Public License along
1997403Sobrien// with this library; see the file COPYING.  If not, write to the Free
2097403Sobrien// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2197403Sobrien// USA.
2297403Sobrien
2397403Sobrien// As a special exception, you may use this file as part of a free software
2497403Sobrien// library without restriction.  Specifically, if other files instantiate
2597403Sobrien// templates or use macros or inline functions from this file, or you compile
2697403Sobrien// this file and link it with other files to produce an executable, this
2797403Sobrien// file does not by itself cause the resulting executable to be covered by
2897403Sobrien// the GNU General Public License.  This exception does not however
2997403Sobrien// invalidate any other reasons why the executable file might be covered by
3097403Sobrien// the GNU General Public License.
3197403Sobrien
3297403Sobrien/** @file c++config.h
3397403Sobrien *  This is an internal header file, included by other library headers.
3497403Sobrien *  You should not attempt to use it directly.
3597403Sobrien */
3697403Sobrien
37107606Sobrien#ifndef _CXXCONFIG
3897403Sobrien#define _CXXCONFIG 1
3997403Sobrien
4097403Sobrien// Pick up any OS-specific definitions.
4197403Sobrien#include <bits/os_defines.h>
4297403Sobrien
4397403Sobrien// Pick up any CPU-specific definitions.
4497403Sobrien#include <bits/cpu_defines.h>
4597403Sobrien
4697403Sobrien// The current version of the C++ library in compressed ISO date format.
4797403Sobrien#define __GLIBCXX__ 
4897403Sobrien
4997403Sobrien// Macros for visibility.
5097403Sobrien#define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
5197403Sobrien
5297403Sobrien#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
5397403Sobrien#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
5497403Sobrien#else
5597403Sobrien#define _GLIBCXX_VISIBILITY(V) 
5697403Sobrien#endif
5797403Sobrien
58107606Sobrien// Macros for controlling various namespace association schemes and modes.
59107606Sobrien#ifdef _GLIBCXX_DEBUG
60107606Sobrien# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
6197403Sobrien#endif
6297403Sobrien
6397403Sobrien#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
6497403Sobrien
6597403Sobrien// Macros for namespace scope.
6697403Sobrien// _GLIBCXX_BEGIN_NAMESPACE
6797403Sobrien// _GLIBCXX_END_NAMESPACE
6897403Sobrien// _GLIBCXX_BEGIN_NESTED_NAMESPACE
6997403Sobrien// _GLIBCXX_END_NESTED_NAMESPACE
7097403Sobrien#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
7197403Sobrien# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)  namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
7297403Sobrien# define _GLIBCXX_END_NESTED_NAMESPACE } }
7397403Sobrien# define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
7497403Sobrien# define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
75102782Skan#else
76102782Skan# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) { 
77102782Skan# define _GLIBCXX_END_NAMESPACE } 
78102782Skan# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
79102782Skan#  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
80102782Skan#  define _GLIBCXX_END_NESTED_NAMESPACE  } }
81102782Skan# else
82102782Skan#  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
83102782Skan#  define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
8497403Sobrien# endif
8597403Sobrien#endif
8697403Sobrien
8797403Sobrien// Namespace associations for versioning mode.
8897403Sobrien#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
89namespace std
90{
91  namespace _6 { }
92  using namespace _6 __attribute__ ((strong));
93}
94
95// In addition, other supported namespace configurations.
96namespace __gnu_cxx 
97{ 
98  namespace _6 { }
99  using namespace _6 __attribute__ ((strong));
100}
101
102namespace std
103{
104  namespace tr1 
105  { 
106    namespace _6 { }
107    using namespace _6 __attribute__ ((strong));
108  }
109}
110#endif
111
112// Namespace associations for debug mode.
113#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
114namespace std
115{ 
116  namespace __norm { }
117  namespace __debug { }
118  using namespace __debug __attribute__ ((strong)); 
119}
120
121namespace __gnu_cxx
122{
123  namespace __norm { }
124  namespace __debug { }
125  using namespace __debug __attribute__ ((strong)); 
126}
127
128# define _GLIBCXX_STD __norm
129# define _GLIBCXX_EXT __norm
130# define _GLIBCXX_EXTERN_TEMPLATE 0
131# if __NO_INLINE__ && !__GXX_WEAK__
132#  warning debug mode without inlining may fail due to lack of weak symbols
133# endif
134#else
135#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
136# define _GLIBCXX_STD _6
137# define _GLIBCXX_EXT _6
138#else
139# define _GLIBCXX_STD std
140# define _GLIBCXX_EXT __gnu_cxx
141#endif
142#endif
143
144/* Define if compatibility should be provided for -mlong-double-64. */
145#undef _GLIBCXX_LONG_DOUBLE_COMPAT
146
147// XXX GLIBCXX_ABI Deprecated
148// Namespace associations for long double 128 mode.
149_GLIBCXX_BEGIN_NAMESPACE(std)
150#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
151# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
152# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
153# define _GLIBCXX_END_LDBL_NAMESPACE }
154  namespace __gnu_cxx_ldbl128 { }
155  using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
156#else
157# define _GLIBCXX_LDBL_NAMESPACE
158# define _GLIBCXX_BEGIN_LDBL_NAMESPACE
159# define _GLIBCXX_END_LDBL_NAMESPACE
160#endif
161_GLIBCXX_END_NAMESPACE
162
163
164// Allow use of "export template." This is currently not a feature
165// that g++ supports.
166// #define _GLIBCXX_EXPORT_TEMPLATE 1
167
168// Allow use of the GNU syntax extension, "extern template." This
169// extension is fully documented in the g++ manual, but in a nutshell,
170// it inhibits all implicit instantiations and is used throughout the
171// library to avoid multiple weak definitions for required types that
172// are already explicitly instantiated in the library binary. This
173// substantially reduces the binary size of resulting executables.
174#ifndef _GLIBCXX_EXTERN_TEMPLATE
175# define _GLIBCXX_EXTERN_TEMPLATE 1
176#endif
177
178
179// Certain function definitions that are meant to be overridable from
180// user code are decorated with this macro.  For some targets, this
181// macro causes these definitions to be weak.
182#ifndef _GLIBCXX_WEAK_DEFINITION
183# define _GLIBCXX_WEAK_DEFINITION
184#endif
185
186// The remainder of the prewritten config is automatic; all the
187// user hooks are listed above.
188
189// Create a boolean flag to be used to determine if --fast-math is set.
190#ifdef __FAST_MATH__
191# define _GLIBCXX_FAST_MATH 1
192#else
193# define _GLIBCXX_FAST_MATH 0
194#endif
195
196// This marks string literals in header files to be extracted for eventual
197// translation.  It is primarily used for messages in thrown exceptions; see
198// src/functexcept.cc.  We use __N because the more traditional _N is used
199// for something else under certain OSes (see BADNAMES).
200#define __N(msgid)     (msgid)
201
202// For example, <windows.h> is known to #define min and max as macros...
203#undef min
204#undef max
205
206// End of prewritten config; the discovered settings follow.
207