diff options
author | kan <kan@FreeBSD.org> | 2007-05-19 01:25:07 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2007-05-19 01:25:07 +0000 |
commit | 7865836f4b0f698454c31b4593effcb032c22c1e (patch) | |
tree | ea6c2718dc1e45ed535d194df808ef31f0ebac92 /contrib/libstdc++/include/c_std | |
parent | 1f9ea4d0a40cca64d60cf4dab152349da7b9dddf (diff) | |
download | FreeBSD-src-7865836f4b0f698454c31b4593effcb032c22c1e.zip FreeBSD-src-7865836f4b0f698454c31b4593effcb032c22c1e.tar.gz |
GCC 4.2.0 release C++ standard library and runtime support code.
Diffstat (limited to 'contrib/libstdc++/include/c_std')
19 files changed, 379 insertions, 301 deletions
diff --git a/contrib/libstdc++/include/c_std/cmath.tcc b/contrib/libstdc++/include/c_std/cmath.tcc index d771467..472324a 100644 --- a/contrib/libstdc++/include/c_std/cmath.tcc +++ b/contrib/libstdc++/include/c_std/cmath.tcc @@ -1,6 +1,6 @@ // -*- C++ -*- C math library. -// Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -29,11 +29,15 @@ // This file was written by Gabriel Dos Reis <gdr@codesourcery.com> +/** @file cmath.tcc + * This is a Standard C++ Library file. + */ + #ifndef _GLIBCXX_CMATH_TCC #define _GLIBCXX_CMATH_TCC 1 -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + template<typename _Tp> inline _Tp __cmath_power(_Tp __x, unsigned int __n) @@ -49,6 +53,7 @@ namespace std return __y; } -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cassert.h b/contrib/libstdc++/include/c_std/std_cassert.h index 9fc1079..0e5c77a 100644 --- a/contrib/libstdc++/include/c_std/std_cassert.h +++ b/contrib/libstdc++/include/c_std/std_cassert.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 19.2 Assertions -// - /** @file cassert * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c assert.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 19.2 Assertions +// + // No include guards on this header... #pragma GCC system_header diff --git a/contrib/libstdc++/include/c_std/std_cctype.h b/contrib/libstdc++/include/c_std/std_cctype.h index 65a4214..61a55cb 100644 --- a/contrib/libstdc++/include/c_std/std_cctype.h +++ b/contrib/libstdc++/include/c_std/std_cctype.h @@ -1,6 +1,7 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -27,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: <ccytpe> -// - -/** @file cctype +/** @file include/cctype * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c ctype.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: <ccytpe> +// + #ifndef _GLIBCXX_CCTYPE #define _GLIBCXX_CCTYPE 1 @@ -63,8 +65,8 @@ #undef tolower #undef toupper -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::isalnum; using ::isalpha; using ::iscntrl; @@ -78,6 +80,7 @@ namespace std using ::isxdigit; using ::tolower; using ::toupper; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cerrno.h b/contrib/libstdc++/include/c_std/std_cerrno.h index 7915e14..e597b8f 100644 --- a/contrib/libstdc++/include/c_std/std_cerrno.h +++ b/contrib/libstdc++/include/c_std/std_cerrno.h @@ -1,6 +1,7 @@ // The -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -27,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 19.3 Error numbers -// - /** @file cerrno * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c errno.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 19.3 Error numbers +// + #ifndef _GLIBCXX_CERRNO #define _GLIBCXX_CERRNO 1 diff --git a/contrib/libstdc++/include/c_std/std_cfloat.h b/contrib/libstdc++/include/c_std/std_cfloat.h index 4c5bb00..2b51449 100644 --- a/contrib/libstdc++/include/c_std/std_cfloat.h +++ b/contrib/libstdc++/include/c_std/std_cfloat.h @@ -1,6 +1,7 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -27,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - -/** @file cfloat +/** @file include/cfloat * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c float.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 18.2.2 Implementation properties: C library +// + #ifndef _GLIBCXX_CFLOAT #define _GLIBCXX_CFLOAT 1 diff --git a/contrib/libstdc++/include/c_std/std_ciso646.h b/contrib/libstdc++/include/c_std/std_ciso646.h index 0993a0a..3e391b4 100644 --- a/contrib/libstdc++/include/c_std/std_ciso646.h +++ b/contrib/libstdc++/include/c_std/std_ciso646.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -33,5 +33,6 @@ * * This is the C++ version of the Standard C Library header @c iso646.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ diff --git a/contrib/libstdc++/include/c_std/std_climits.h b/contrib/libstdc++/include/c_std/std_climits.h index f4e1d8f..e85869f 100644 --- a/contrib/libstdc++/include/c_std/std_climits.h +++ b/contrib/libstdc++/include/c_std/std_climits.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - -/** @file climits +/** @file include/climits * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c limits.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 18.2.2 Implementation properties: C library +// + #ifndef _GLIBCXX_CLIMITS #define _GLIBCXX_CLIMITS 1 diff --git a/contrib/libstdc++/include/c_std/std_clocale.h b/contrib/libstdc++/include/c_std/std_clocale.h index 988b849..51e6440 100644 --- a/contrib/libstdc++/include/c_std/std_clocale.h +++ b/contrib/libstdc++/include/c_std/std_clocale.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,35 +28,38 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 18.2.2 Implementation properties: C library -// - /** @file clocale * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c locale.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 18.2.2 Implementation properties: C library +// + #ifndef _GLIBCXX_CLOCALE #define _GLIBCXX_CLOCALE 1 #pragma GCC system_header +#include <bits/c++config.h> #include <locale.h> // Get rid of those macros defined in <locale.h> in lieu of real functions. #undef setlocale #undef localeconv -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::lconv; using ::setlocale; using ::localeconv; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cmath.h b/contrib/libstdc++/include/c_std/std_cmath.h index 729f510..897290a 100644 --- a/contrib/libstdc++/include/c_std/std_cmath.h +++ b/contrib/libstdc++/include/c_std/std_cmath.h @@ -1,6 +1,6 @@ // -*- C++ -*- C forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 26.5 C library -// - -/** @file cmath +/** @file include/cmath * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c math.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 26.5 C library +// + #ifndef _GLIBCXX_CMATH #define _GLIBCXX_CMATH 1 @@ -48,6 +49,7 @@ #include <bits/c++config.h> #include <bits/cpp_type_traits.h> +#include <ext/type_traits.h> #include <math.h> @@ -77,9 +79,8 @@ #undef tan #undef tanh +_GLIBCXX_BEGIN_NAMESPACE(std) -namespace std -{ // Forward declaration of a helper function. This really should be // an `exported' forward declaration. template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int); @@ -107,11 +108,10 @@ namespace std { return __builtin_acosl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type acos(_Tp __x) - { - return __builtin_acos(__x); - } + { return __builtin_acos(__x); } using ::asin; @@ -124,7 +124,8 @@ namespace std { return __builtin_asinl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type asin(_Tp __x) { return __builtin_asin(__x); } @@ -139,7 +140,8 @@ namespace std { return __builtin_atanl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type atan(_Tp __x) { return __builtin_atan(__x); } @@ -154,8 +156,9 @@ namespace std { return __builtin_atan2l(__y, __x); } template<typename _Tp, typename _Up> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type - && __is_integer<_Up>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value + && __is_integer<_Up>::__value, + double>::__type atan2(_Tp __y, _Up __x) { return __builtin_atan2(__y, __x); } @@ -170,7 +173,8 @@ namespace std { return __builtin_ceill(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type ceil(_Tp __x) { return __builtin_ceil(__x); } @@ -185,7 +189,8 @@ namespace std { return __builtin_cosl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type cos(_Tp __x) { return __builtin_cos(__x); } @@ -200,7 +205,8 @@ namespace std { return __builtin_coshl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type cosh(_Tp __x) { return __builtin_cosh(__x); } @@ -215,7 +221,8 @@ namespace std { return __builtin_expl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type exp(_Tp __x) { return __builtin_exp(__x); } @@ -230,7 +237,8 @@ namespace std { return __builtin_fabsl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type fabs(_Tp __x) { return __builtin_fabs(__x); } @@ -245,7 +253,8 @@ namespace std { return __builtin_floorl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type floor(_Tp __x) { return __builtin_floor(__x); } @@ -270,7 +279,8 @@ namespace std { return __builtin_frexpl(__x, __exp); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type frexp(_Tp __x, int* __exp) { return __builtin_frexp(__x, __exp); } @@ -285,7 +295,8 @@ namespace std { return __builtin_ldexpl(__x, __exp); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type ldexp(_Tp __x, int __exp) { return __builtin_ldexp(__x, __exp); } @@ -300,7 +311,8 @@ namespace std { return __builtin_logl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type log(_Tp __x) { return __builtin_log(__x); } @@ -315,7 +327,8 @@ namespace std { return __builtin_log10l(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type log10(_Tp __x) { return __builtin_log10(__x); } @@ -350,15 +363,15 @@ namespace std inline double pow(double __x, int __i) - { return __pow_helper(__x, __i); } + { return __builtin_powi(__x, __i); } inline float pow(float __x, int __n) - { return __pow_helper(__x, __n); } + { return __builtin_powif(__x, __n); } inline long double pow(long double __x, int __n) - { return __pow_helper(__x, __n); } + { return __builtin_powil(__x, __n); } using ::sin; @@ -371,7 +384,8 @@ namespace std { return __builtin_sinl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type sin(_Tp __x) { return __builtin_sin(__x); } @@ -386,7 +400,8 @@ namespace std { return __builtin_sinhl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type sinh(_Tp __x) { return __builtin_sinh(__x); } @@ -401,7 +416,8 @@ namespace std { return __builtin_sqrtl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type sqrt(_Tp __x) { return __builtin_sqrt(__x); } @@ -416,7 +432,8 @@ namespace std { return __builtin_tanl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type tan(_Tp __x) { return __builtin_tan(__x); } @@ -431,18 +448,21 @@ namespace std { return __builtin_tanhl(__x); } template<typename _Tp> - inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type + inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, + double>::__type tanh(_Tp __x) { return __builtin_tanh(__x); } -} + +_GLIBCXX_END_NAMESPACE #if _GLIBCXX_USE_C99_MATH #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC // These are possible macros imported from C99-land. For strict // conformance, remove possible C99-injected names from the global // namespace, and sequester them in the __gnu_cxx extension namespace. -namespace __gnu_cxx -{ + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + template<typename _Tp> inline int __capture_fpclassify(_Tp __f) { return fpclassify(__f); } @@ -495,7 +515,8 @@ namespace __gnu_cxx inline int __capture_isunordered(_Tp __f1, _Tp __f2) { return isunordered(__f1, __f2); } -} + +_GLIBCXX_END_NAMESPACE // Only undefine the C99 FP macros, if actually captured for namespace movement #undef fpclassify @@ -510,81 +531,65 @@ namespace __gnu_cxx #undef islessequal #undef islessgreater #undef isunordered -#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ -#endif -#if _GLIBCXX_USE_C99_MATH -#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + template<typename _Tp> inline int - fpclassify(_Tp __f) { return __capture_fpclassify(__f); } + fpclassify(_Tp __f) { return ::__gnu_cxx::__capture_fpclassify(__f); } template<typename _Tp> inline int - isfinite(_Tp __f) { return __capture_isfinite(__f); } + isfinite(_Tp __f) { return ::__gnu_cxx::__capture_isfinite(__f); } template<typename _Tp> inline int - isinf(_Tp __f) { return __capture_isinf(__f); } + isinf(_Tp __f) { return ::__gnu_cxx::__capture_isinf(__f); } template<typename _Tp> inline int - isnan(_Tp __f) { return __capture_isnan(__f); } + isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); } template<typename _Tp> inline int - isnormal(_Tp __f) { return __capture_isnormal(__f); } + isnormal(_Tp __f) { return ::__gnu_cxx::__capture_isnormal(__f); } template<typename _Tp> inline int - signbit(_Tp __f) { return __capture_signbit(__f); } + signbit(_Tp __f) { return ::__gnu_cxx::__capture_signbit(__f); } template<typename _Tp> inline int - isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); } + isgreater(_Tp __f1, _Tp __f2) + { return ::__gnu_cxx::__capture_isgreater(__f1, __f2); } template<typename _Tp> inline int isgreaterequal(_Tp __f1, _Tp __f2) - { return __capture_isgreaterequal(__f1, __f2); } + { return ::__gnu_cxx::__capture_isgreaterequal(__f1, __f2); } template<typename _Tp> inline int - isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); } + isless(_Tp __f1, _Tp __f2) + { return ::__gnu_cxx::__capture_isless(__f1, __f2); } template<typename _Tp> inline int islessequal(_Tp __f1, _Tp __f2) - { return __capture_islessequal(__f1, __f2); } + { return ::__gnu_cxx::__capture_islessequal(__f1, __f2); } template<typename _Tp> inline int islessgreater(_Tp __f1, _Tp __f2) - { return __capture_islessgreater(__f1, __f2); } + { return ::__gnu_cxx::__capture_islessgreater(__f1, __f2); } template<typename _Tp> inline int isunordered(_Tp __f1, _Tp __f2) - { return __capture_isunordered(__f1, __f2); } -} - -namespace std -{ - using __gnu_cxx::fpclassify; - using __gnu_cxx::isfinite; - using __gnu_cxx::isinf; - using __gnu_cxx::isnan; - using __gnu_cxx::isnormal; - using __gnu_cxx::signbit; - using __gnu_cxx::isgreater; - using __gnu_cxx::isgreaterequal; - using __gnu_cxx::isless; - using __gnu_cxx::islessequal; - using __gnu_cxx::islessgreater; - using __gnu_cxx::isunordered; -} + { return ::__gnu_cxx::__capture_isunordered(__f1, __f2); } + +_GLIBCXX_END_NAMESPACE + #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ #endif diff --git a/contrib/libstdc++/include/c_std/std_csetjmp.h b/contrib/libstdc++/include/c_std/std_csetjmp.h index d5fe073..946e7e3 100644 --- a/contrib/libstdc++/include/c_std/std_csetjmp.h +++ b/contrib/libstdc++/include/c_std/std_csetjmp.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,24 +28,26 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.4.6 C library -// - /** @file csetjmp * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c setjmp.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.4.6 C library +// + #ifndef _GLIBCXX_CSETJMP #define _GLIBCXX_CSETJMP 1 #pragma GCC system_header +#include <bits/c++config.h> #include <setjmp.h> // Get rid of those macros defined in <setjmp.h> in lieu of real functions. @@ -56,10 +58,11 @@ #define setjmp(env) setjmp (env) #endif -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::jmp_buf; using ::longjmp; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_csignal.h b/contrib/libstdc++/include/c_std/std_csignal.h index 5734cf6..0ce5e2f 100644 --- a/contrib/libstdc++/include/c_std/std_csignal.h +++ b/contrib/libstdc++/include/c_std/std_csignal.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,34 +28,37 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.4.6 C library -// - /** @file csignal * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c signal.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.4.6 C library +// + #ifndef _GLIBCXX_CSIGNAL #define _GLIBCXX_CSIGNAL 1 #pragma GCC system_header +#include <bits/c++config.h> #include <signal.h> // Get rid of those macros defined in <signal.h> in lieu of real functions. #undef raise -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::sig_atomic_t; using ::signal; using ::raise; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cstdarg.h b/contrib/libstdc++/include/c_std/std_cstdarg.h index ca362e4..53c29c8 100644 --- a/contrib/libstdc++/include/c_std/std_cstdarg.h +++ b/contrib/libstdc++/include/c_std/std_cstdarg.h @@ -1,6 +1,7 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -27,24 +28,26 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file cstdarg +/** @file include/cstdarg * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c stdarg.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.4.6 C library +// + #ifndef _GLIBCXX_CSTDARG #define _GLIBCXX_CSTDARG 1 #pragma GCC system_header +#include <bits/c++config.h> #include <stdarg.h> // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 @@ -52,9 +55,10 @@ #define va_end(ap) va_end (ap) #endif -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::va_list; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cstddef.h b/contrib/libstdc++/include/c_std/std_cstddef.h index 4fa82c6..bfa8388 100644 --- a/contrib/libstdc++/include/c_std/std_cstddef.h +++ b/contrib/libstdc++/include/c_std/std_cstddef.h @@ -1,6 +1,7 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -15,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -27,30 +28,33 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 18.1 Types -// - /** @file cstddef * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c stddef.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 18.1 Types +// + #ifndef _GLIBCXX_CSTDDEF #define _GLIBCXX_CSTDDEF 1 #pragma GCC system_header +#include <bits/c++config.h> #include <stddef.h> -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::ptrdiff_t; using ::size_t; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cstdio.h b/contrib/libstdc++/include/c_std/std_cstdio.h index f31e58e..3935ef4 100644 --- a/contrib/libstdc++/include/c_std/std_cstdio.h +++ b/contrib/libstdc++/include/c_std/std_cstdio.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 27.8.2 C Library files -// - -/** @file cstdio +/** @file include/cstdio * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c stdio.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 27.8.2 C Library files +// + #ifndef _GLIBCXX_CSTDIO #define _GLIBCXX_CSTDIO 1 @@ -94,8 +95,8 @@ #undef vprintf #undef vsprintf -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::FILE; using ::fpos_t; @@ -140,7 +141,8 @@ namespace std using ::vfprintf; using ::vprintf; using ::vsprintf; -} + +_GLIBCXX_END_NAMESPACE #if _GLIBCXX_USE_C99 @@ -150,19 +152,20 @@ namespace std #undef vsnprintf #undef vsscanf -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int - (snprintf)(char * restrict, size_t, const char * restrict, ...); + (snprintf)(char * restrict, size_t, const char * restrict, ...); extern "C" int - (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); + (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * restrict, __gnuc_va_list); extern "C" int - (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); + (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); extern "C" int - (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); + (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); #endif + #if !_GLIBCXX_USE_C99_DYNAMIC using ::snprintf; using ::vfscanf; @@ -170,16 +173,19 @@ namespace __gnu_cxx using ::vsnprintf; using ::vsscanf; #endif -} - -namespace std -{ - using __gnu_cxx::snprintf; - using __gnu_cxx::vfscanf; - using __gnu_cxx::vscanf; - using __gnu_cxx::vsnprintf; - using __gnu_cxx::vsscanf; -} + +_GLIBCXX_END_NAMESPACE + +_GLIBCXX_BEGIN_NAMESPACE(std) + + using ::__gnu_cxx::snprintf; + using ::__gnu_cxx::vfscanf; + using ::__gnu_cxx::vscanf; + using ::__gnu_cxx::vsnprintf; + using ::__gnu_cxx::vsscanf; + +_GLIBCXX_END_NAMESPACE + #endif #endif diff --git a/contrib/libstdc++/include/c_std/std_cstdlib.h b/contrib/libstdc++/include/c_std/std_cstdlib.h index d2d6e37..5c3d586 100644 --- a/contrib/libstdc++/include/c_std/std_cstdlib.h +++ b/contrib/libstdc++/include/c_std/std_cstdlib.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.4.6 C library -// - -/** @file cstdlib +/** @file include/cstdlib * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c stdlib.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.4.6 C library +// + #ifndef _GLIBCXX_CSTDLIB #define _GLIBCXX_CSTDLIB 1 @@ -49,6 +50,25 @@ #include <bits/c++config.h> #include <cstddef> +#if !_GLIBCXX_HOSTED +// The C standard does not require a freestanding implementation to +// provide <stdlib.h>. However, the C++ standard does still require +// <cstdlib> -- but only the functionality mentioned in +// [lib.support.start.term]. + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +_GLIBCXX_BEGIN_NAMESPACE(std) + + extern "C" void abort(void); + extern "C" int atexit(void (*)()); + extern "C" void exit(int); + +_GLIBCXX_END_NAMESPACE + +#else + #include <stdlib.h> // Get rid of those macros defined in <stdlib.h> in lieu of real functions. @@ -81,8 +101,8 @@ #undef wcstombs #undef wctomb -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::div_t; using ::ldiv_t; @@ -124,7 +144,8 @@ namespace std inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } -} + +_GLIBCXX_END_NAMESPACE #if _GLIBCXX_USE_C99 @@ -137,8 +158,8 @@ namespace std #undef strtof #undef strtold -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC using ::lldiv_t; #endif @@ -152,17 +173,14 @@ namespace __gnu_cxx inline long long abs(long long __x) { return __x >= 0 ? __x : -__x; } - inline long long - llabs(long long __x) { return __x >= 0 ? __x : -__x; } - #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC + using ::llabs; + inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } - inline lldiv_t - lldiv(long long __n, long long __d) - { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + using ::lldiv; #endif #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC @@ -179,26 +197,31 @@ namespace __gnu_cxx #endif using ::strtof; using ::strtold; -} -namespace std -{ +_GLIBCXX_END_NAMESPACE + +_GLIBCXX_BEGIN_NAMESPACE(std) + #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::lldiv_t; + using ::__gnu_cxx::lldiv_t; #endif - using __gnu_cxx::_Exit; - using __gnu_cxx::abs; - using __gnu_cxx::llabs; + using ::__gnu_cxx::_Exit; + using ::__gnu_cxx::abs; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::div; - using __gnu_cxx::lldiv; -#endif - using __gnu_cxx::atoll; - using __gnu_cxx::strtof; - using __gnu_cxx::strtoll; - using __gnu_cxx::strtoull; - using __gnu_cxx::strtold; -} + using ::__gnu_cxx::llabs; + using ::__gnu_cxx::div; + using ::__gnu_cxx::lldiv; #endif + using ::__gnu_cxx::atoll; + using ::__gnu_cxx::strtof; + using ::__gnu_cxx::strtoll; + using ::__gnu_cxx::strtoull; + using ::__gnu_cxx::strtold; + +_GLIBCXX_END_NAMESPACE + +#endif // _GLIBCXX_USE_C99 + +#endif // !_GLIBCXX_HOSTED #endif diff --git a/contrib/libstdc++/include/c_std/std_cstring.h b/contrib/libstdc++/include/c_std/std_cstring.h index dad40c2..5fef6b0 100644 --- a/contrib/libstdc++/include/c_std/std_cstring.h +++ b/contrib/libstdc++/include/c_std/std_cstring.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,26 +28,27 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.4.6 C library -// - /** @file cstring * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c string.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.4.6 C library +// + #ifndef _GLIBCXX_CSTRING #define _GLIBCXX_CSTRING 1 #pragma GCC system_header +#include <bits/c++config.h> #include <cstddef> - #include <string.h> // Get rid of those macros defined in <string.h> in lieu of real functions. @@ -74,8 +75,8 @@ #undef strerror #undef strlen -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::memcpy; using ::memmove; using ::strcpy; @@ -123,6 +124,7 @@ namespace std inline char* strstr(char* __s1, const char* __s2) { return __builtin_strstr(const_cast<const char*>(__s1), __s2); } -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_ctime.h b/contrib/libstdc++/include/c_std/std_ctime.h index fe890df..9f7f15c 100644 --- a/contrib/libstdc++/include/c_std/std_ctime.h +++ b/contrib/libstdc++/include/c_std/std_ctime.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,26 +28,26 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 20.5 Date and time -// - -/** @file ctime +/** @file include/ctime * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c time.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 20.5 Date and time +// + #ifndef _GLIBCXX_CTIME #define _GLIBCXX_CTIME 1 #pragma GCC system_header #include <cstddef> - #include <time.h> // Get rid of those macros defined in <time.h> in lieu of real functions. @@ -61,8 +61,8 @@ #undef localtime #undef strftime -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::clock_t; using ::time_t; using ::tm; @@ -76,6 +76,7 @@ namespace std using ::gmtime; using ::localtime; using ::strftime; -} + +_GLIBCXX_END_NAMESPACE #endif diff --git a/contrib/libstdc++/include/c_std/std_cwchar.h b/contrib/libstdc++/include/c_std/std_cwchar.h index d9e11e9..20cb804 100644 --- a/contrib/libstdc++/include/c_std/std_cwchar.h +++ b/contrib/libstdc++/include/c_std/std_cwchar.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 21.4 -// - -/** @file cwchar +/** @file include/cwchar * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c wchar.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: 21.4 +// + #ifndef _GLIBCXX_CWCHAR #define _GLIBCXX_CWCHAR 1 @@ -66,10 +67,11 @@ extern "C" } #endif -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::mbstate_t; -} + +_GLIBCXX_END_NAMESPACE // Get rid of those macros defined in <wchar.h> in lieu of real functions. #undef btowc @@ -138,8 +140,9 @@ namespace std #undef wscanf #if _GLIBCXX_USE_WCHAR_T -namespace std -{ + +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::wint_t; using ::btowc; @@ -211,7 +214,7 @@ namespace std using ::wcspbrk; inline wchar_t* - wcspbrk(wchar_t* __s1, wchar_t* __s2) + wcspbrk(wchar_t* __s1, const wchar_t* __s2) { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); } using ::wcsrchr; @@ -231,7 +234,8 @@ namespace std inline wchar_t* wmemchr(wchar_t* __p, wchar_t __c, size_t __n) { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); } -} + +_GLIBCXX_END_NAMESPACE #if _GLIBCXX_USE_C99 @@ -239,8 +243,8 @@ namespace std #undef wcstoll #undef wcstoull -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" long double (wcstold)(const wchar_t * restrict, wchar_t ** restrict); @@ -258,14 +262,17 @@ namespace __gnu_cxx using ::wcstoll; using ::wcstoull; #endif -} -namespace std -{ - using __gnu_cxx::wcstold; - using __gnu_cxx::wcstoll; - using __gnu_cxx::wcstoull; -} +_GLIBCXX_END_NAMESPACE + +_GLIBCXX_BEGIN_NAMESPACE(std) + + using ::__gnu_cxx::wcstold; + using ::__gnu_cxx::wcstoll; + using ::__gnu_cxx::wcstoull; + +_GLIBCXX_END_NAMESPACE + #endif #endif //_GLIBCXX_USE_WCHAR_T diff --git a/contrib/libstdc++/include/c_std/std_cwctype.h b/contrib/libstdc++/include/c_std/std_cwctype.h index 970c53a..dd0032f 100644 --- a/contrib/libstdc++/include/c_std/std_cwctype.h +++ b/contrib/libstdc++/include/c_std/std_cwctype.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,19 +28,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: <cwctype> -// - -/** @file cwctype +/** @file include/cwctype * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "*.h" implementation files. * * This is the C++ version of the Standard C Library header @c wctype.h, * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. + * contained in the namespace @c std (except for names which are defined + * as macros in C). */ +// +// ISO C++ 14882: <cwctype> +// + #ifndef _GLIBCXX_CWCTYPE #define _GLIBCXX_CWCTYPE 1 @@ -59,25 +60,25 @@ # undef iswblank #endif #undef iswcntrl +#undef iswctype #undef iswdigit #undef iswgraph #undef iswlower #undef iswprint -#undef iswprint #undef iswpunct #undef iswspace #undef iswupper #undef iswxdigit -#undef iswctype +#undef towctrans #undef towlower #undef towupper -#undef towctrans #undef wctrans #undef wctype #if _GLIBCXX_USE_WCHAR_T -namespace std -{ + +_GLIBCXX_BEGIN_NAMESPACE(std) + using ::wint_t; // cwchar using ::wctype_t; @@ -89,22 +90,23 @@ namespace std using ::iswblank; #endif using ::iswcntrl; + using ::iswctype; using ::iswdigit; using ::iswgraph; using ::iswlower; using ::iswprint; - using ::iswprint; using ::iswpunct; using ::iswspace; using ::iswupper; using ::iswxdigit; - using ::iswctype; + using ::towctrans; using ::towlower; using ::towupper; - using ::towctrans; using ::wctrans; using ::wctype; -} + +_GLIBCXX_END_NAMESPACE + #endif //_GLIBCXX_USE_WCHAR_T #endif |