197403Sobrien// Predefined symbols and macros -*- C++ -*-
297403Sobrien
3169691Skan// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4169691Skan// 2006, 2007
5117397Skan// 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
20169691Skan// 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
32169691Skan/** @file c++config.h
33169691Skan *  This is an internal header file, included by other library headers.
34169691Skan *  You should not attempt to use it directly.
35169691Skan */
36169691Skan
37132720Skan#ifndef _CXXCONFIG
38132720Skan#define _CXXCONFIG 1
3997403Sobrien
4097403Sobrien// Pick up any OS-specific definitions.
4197403Sobrien#include <bits/os_defines.h>
4297403Sobrien
43169691Skan// Pick up any CPU-specific definitions.
44169691Skan#include <bits/cpu_defines.h>
45169691Skan
4697403Sobrien// The current version of the C++ library in compressed ISO date format.
47169691Skan#define __GLIBCXX__ 
4897403Sobrien
49169691Skan// Macros for visibility.
50169691Skan#define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
51169691Skan
52169691Skan#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
53169691Skan#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
54169691Skan#else
55169691Skan#define _GLIBCXX_VISIBILITY(V) 
56169691Skan#endif
57169691Skan
58169691Skan// Macros for controlling various namespace association schemes and modes.
59169691Skan#ifdef _GLIBCXX_DEBUG
60169691Skan# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
61169691Skan#endif
62169691Skan
63169691Skan#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
64169691Skan
65169691Skan// Macros for namespace scope.
66169691Skan// _GLIBCXX_BEGIN_NAMESPACE
67169691Skan// _GLIBCXX_END_NAMESPACE
68169691Skan// _GLIBCXX_BEGIN_NESTED_NAMESPACE
69169691Skan// _GLIBCXX_END_NESTED_NAMESPACE
70169691Skan#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
71169691Skan# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)  namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
72169691Skan# define _GLIBCXX_END_NESTED_NAMESPACE } }
73169691Skan# define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6)
74169691Skan# define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE
75169691Skan#else
76169691Skan# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) { 
77169691Skan# define _GLIBCXX_END_NAMESPACE } 
78169691Skan# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
79169691Skan#  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) {
80169691Skan#  define _GLIBCXX_END_NESTED_NAMESPACE  } }
81169691Skan# else
82169691Skan#  define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X)
83169691Skan#  define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE
84169691Skan# endif
85169691Skan#endif
86169691Skan
87169691Skan// Namespace associations for versioning mode.
88169691Skan#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
89169691Skannamespace std
90169691Skan{
91169691Skan  namespace _6 { }
92169691Skan  using namespace _6 __attribute__ ((strong));
93169691Skan}
94169691Skan
95169691Skan// In addition, other supported namespace configurations.
96169691Skannamespace __gnu_cxx 
97169691Skan{ 
98169691Skan  namespace _6 { }
99169691Skan  using namespace _6 __attribute__ ((strong));
100169691Skan}
101169691Skan
102169691Skannamespace std
103169691Skan{
104169691Skan  namespace tr1 
105169691Skan  { 
106169691Skan    namespace _6 { }
107169691Skan    using namespace _6 __attribute__ ((strong));
108169691Skan  }
109169691Skan}
110169691Skan#endif
111169691Skan
112169691Skan// Namespace associations for debug mode.
113169691Skan#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
114169691Skannamespace std
115169691Skan{ 
116169691Skan  namespace __norm { }
117169691Skan  namespace __debug { }
118169691Skan  using namespace __debug __attribute__ ((strong)); 
119169691Skan}
120169691Skan
121169691Skannamespace __gnu_cxx
122169691Skan{
123169691Skan  namespace __norm { }
124169691Skan  namespace __debug { }
125169691Skan  using namespace __debug __attribute__ ((strong)); 
126169691Skan}
127169691Skan
128169691Skan# define _GLIBCXX_STD __norm
129169691Skan# define _GLIBCXX_EXT __norm
130169691Skan# define _GLIBCXX_EXTERN_TEMPLATE 0
131169691Skan# if __NO_INLINE__ && !__GXX_WEAK__
132169691Skan#  warning debug mode without inlining may fail due to lack of weak symbols
133169691Skan# endif
134169691Skan#else
135169691Skan#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
136169691Skan# define _GLIBCXX_STD _6
137169691Skan# define _GLIBCXX_EXT _6
138169691Skan#else
139169691Skan# define _GLIBCXX_STD std
140169691Skan# define _GLIBCXX_EXT __gnu_cxx
141169691Skan#endif
142169691Skan#endif
143169691Skan
144169691Skan/* Define if compatibility should be provided for -mlong-double-64. */
145169691Skan#undef _GLIBCXX_LONG_DOUBLE_COMPAT
146169691Skan
147169691Skan// XXX GLIBCXX_ABI Deprecated
148169691Skan// Namespace associations for long double 128 mode.
149169691Skan_GLIBCXX_BEGIN_NAMESPACE(std)
150169691Skan#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
151169691Skan# define _GLIBCXX_LDBL_NAMESPACE __gnu_cxx_ldbl128::
152169691Skan# define _GLIBCXX_BEGIN_LDBL_NAMESPACE namespace __gnu_cxx_ldbl128 {
153169691Skan# define _GLIBCXX_END_LDBL_NAMESPACE }
154169691Skan  namespace __gnu_cxx_ldbl128 { }
155169691Skan  using namespace __gnu_cxx_ldbl128 __attribute__((__strong__));
156169691Skan#else
157169691Skan# define _GLIBCXX_LDBL_NAMESPACE
158169691Skan# define _GLIBCXX_BEGIN_LDBL_NAMESPACE
159169691Skan# define _GLIBCXX_END_LDBL_NAMESPACE
160169691Skan#endif
161169691Skan_GLIBCXX_END_NAMESPACE
162169691Skan
163169691Skan
164132720Skan// Allow use of "export template." This is currently not a feature
165132720Skan// that g++ supports.
166132720Skan// #define _GLIBCXX_EXPORT_TEMPLATE 1
16797403Sobrien
168117397Skan// Allow use of the GNU syntax extension, "extern template." This
169117397Skan// extension is fully documented in the g++ manual, but in a nutshell,
170117397Skan// it inhibits all implicit instantiations and is used throughout the
171117397Skan// library to avoid multiple weak definitions for required types that
172117397Skan// are already explicitly instantiated in the library binary. This
173117397Skan// substantially reduces the binary size of resulting executables.
174132720Skan#ifndef _GLIBCXX_EXTERN_TEMPLATE
175132720Skan# define _GLIBCXX_EXTERN_TEMPLATE 1
176117397Skan#endif
177117397Skan
17897403Sobrien
179169691Skan// Certain function definitions that are meant to be overridable from
180169691Skan// user code are decorated with this macro.  For some targets, this
181169691Skan// macro causes these definitions to be weak.
182169691Skan#ifndef _GLIBCXX_WEAK_DEFINITION
183169691Skan# define _GLIBCXX_WEAK_DEFINITION
184132720Skan#endif
185107606Sobrien
186132720Skan// The remainder of the prewritten config is automatic; all the
187132720Skan// user hooks are listed above.
18897403Sobrien
189117397Skan// Create a boolean flag to be used to determine if --fast-math is set.
190117397Skan#ifdef __FAST_MATH__
191132720Skan# define _GLIBCXX_FAST_MATH 1
192117397Skan#else
193132720Skan# define _GLIBCXX_FAST_MATH 0
194117397Skan#endif
195117397Skan
196132720Skan// This marks string literals in header files to be extracted for eventual
197132720Skan// translation.  It is primarily used for messages in thrown exceptions; see
198132720Skan// src/functexcept.cc.  We use __N because the more traditional _N is used
199132720Skan// for something else under certain OSes (see BADNAMES).
200132720Skan#define __N(msgid)     (msgid)
20197403Sobrien
202169691Skan// For example, <windows.h> is known to #define min and max as macros...
203169691Skan#undef min
204169691Skan#undef max
205169691Skan
20697403Sobrien// End of prewritten config; the discovered settings follow.
207