1// Predefined symbols and macros -*- C++ -*- 2 3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 4// 2006, 2007 5// Free Software Foundation, Inc. 6// 7// This file is part of the GNU ISO C++ Library. This library is free 8// software; you can redistribute it and/or modify it under the 9// terms of the GNU General Public License as published by the 10// Free Software Foundation; either version 2, or (at your option) 11// any later version. 12 13// This library is distributed in the hope that it will be useful, 14// but WITHOUT ANY WARRANTY; without even the implied warranty of 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16// GNU General Public License for more details. 17 18// You should have received a copy of the GNU General Public License along 19// with this library; see the file COPYING. If not, write to the Free 20// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 21// USA. 22 23// As a special exception, you may use this file as part of a free software 24// library without restriction. Specifically, if other files instantiate 25// templates or use macros or inline functions from this file, or you compile 26// this file and link it with other files to produce an executable, this 27// file does not by itself cause the resulting executable to be covered by 28// the GNU General Public License. This exception does not however 29// invalidate any other reasons why the executable file might be covered by 30// the GNU General Public License. 31 32/** @file c++config.h 33 * This is an internal header file, included by other library headers. 34 * You should not attempt to use it directly. 35 */ 36 37#ifndef _CXXCONFIG 38#define _CXXCONFIG 1 39 40// Pick up any OS-specific definitions. 41#include <bits/os_defines.h> 42 43// Pick up any CPU-specific definitions. 44#include <bits/cpu_defines.h> 45 46// The current version of the C++ library in compressed ISO date format. 47#define __GLIBCXX__ 48 49// Macros for visibility. 50#define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 51 52#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 53#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) 54#else 55#define _GLIBCXX_VISIBILITY(V) 56#endif 57 58// Macros for controlling various namespace association schemes and modes. 59#ifdef _GLIBCXX_DEBUG 60# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1 61#endif 62 63#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 64 65// Macros for namespace scope. 66// _GLIBCXX_BEGIN_NAMESPACE 67// _GLIBCXX_END_NAMESPACE 68// _GLIBCXX_BEGIN_NESTED_NAMESPACE 69// _GLIBCXX_END_NESTED_NAMESPACE 70#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 71# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) { 72# define _GLIBCXX_END_NESTED_NAMESPACE } } 73# define _GLIBCXX_BEGIN_NAMESPACE(X) _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, _6) 74# define _GLIBCXX_END_NAMESPACE _GLIBCXX_END_NESTED_NAMESPACE 75#else 76# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) { 77# define _GLIBCXX_END_NAMESPACE } 78# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 79# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) namespace X { namespace Y _GLIBCXX_VISIBILITY(default) { 80# define _GLIBCXX_END_NESTED_NAMESPACE } } 81# else 82# define _GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y) _GLIBCXX_BEGIN_NAMESPACE(X) 83# define _GLIBCXX_END_NESTED_NAMESPACE _GLIBCXX_END_NAMESPACE 84# endif 85#endif 86 87// Namespace associations for versioning mode. 88#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