diff options
Diffstat (limited to 'libstdc++-v3/include/c_std/bits')
-rw-r--r-- | libstdc++-v3/include/c_std/bits/cmath.tcc | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cctype.h | 44 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cerrno.h | 16 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cfloat.h | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_climits.h | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_clocale.h | 11 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cmath.h | 687 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_csetjmp.h | 9 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_csignal.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cstdarg.h | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cstddef.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cstdio.h | 180 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cstdlib.h | 172 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cstring.h | 73 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_ctime.h | 21 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cwchar.h | 227 | ||||
-rw-r--r-- | libstdc++-v3/include/c_std/bits/std_cwctype.h | 51 |
17 files changed, 793 insertions, 726 deletions
diff --git a/libstdc++-v3/include/c_std/bits/cmath.tcc b/libstdc++-v3/include/c_std/bits/cmath.tcc index c61df979bfa..9b86bbb9da6 100644 --- a/libstdc++-v3/include/c_std/bits/cmath.tcc +++ b/libstdc++-v3/include/c_std/bits/cmath.tcc @@ -32,7 +32,8 @@ #ifndef _CPP_BITS_CMATH_TCC #define _CPP_BITS_CMATH_TCC 1 -namespace std { +namespace std +{ export template<typename _Tp> _Tp __cmath_power(_Tp __x, unsigned int __n) diff --git a/libstdc++-v3/include/c_std/bits/std_cctype.h b/libstdc++-v3/include/c_std/bits/std_cctype.h index e03a4fd086b..189f4f5384e 100644 --- a/libstdc++-v3/include/c_std/bits/std_cctype.h +++ b/libstdc++-v3/include/c_std/bits/std_cctype.h @@ -31,20 +31,15 @@ // ISO C++ 14882: <ccytpe> // -// Note: This is not a conforming implementation. - #ifndef _CPP_CCTYPE #define _CPP_CCTYPE 1 -#include <bits/c++config.h> - #pragma GCC system_header #include <ctype.h> // Get rid of those macros defined in <ctype.h> in lieu of real functions. #undef isalnum #undef isalpha -#undef isblank #undef iscntrl #undef isdigit #undef isgraph @@ -59,32 +54,19 @@ namespace std { - extern "C" int isalnum(int __c); - extern "C" int isalpha(int __c); - extern "C" int isblank(int __c); - extern "C" int iscntrl(int __c); - extern "C" int isdigit(int __c); - extern "C" int isgraph(int __c); - extern "C" int islower(int __c); - extern "C" int isprint(int __c); - extern "C" int ispunct(int __c); - extern "C" int isspace(int __c); - extern "C" int isupper(int __c); - extern "C" int isxdigit(int __c); - extern "C" int tolower(int __c); - extern "C" int toupper(int __c); + using ::isalnum; + using ::isalpha; + using ::iscntrl; + using ::isdigit; + using ::isgraph; + using ::islower; + using ::isprint; + using ::ispunct; + using ::isspace; + using ::isupper; + using ::isxdigit; + using ::tolower; + using ::toupper; } #endif - - - - - - - - - - - - diff --git a/libstdc++-v3/include/c_std/bits/std_cerrno.h b/libstdc++-v3/include/c_std/bits/std_cerrno.h index 1dc2d137e39..7f1cdf66565 100644 --- a/libstdc++-v3/include/c_std/bits/std_cerrno.h +++ b/libstdc++-v3/include/c_std/bits/std_cerrno.h @@ -1,6 +1,6 @@ // The -*- C++ -*- error number header. -// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2001 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 @@ -31,21 +31,15 @@ // ISO C++ 14882: 19.3 Error numbers // -// Note: This is not a conforming implementation. - #ifndef _CPP_CERRNO #define _CPP_CERRNO 1 #pragma GCC system_header #include <errno.h> -namespace std -{ - extern "C" int errno; -} - +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef errno +#define errno errno #endif - - - +#endif diff --git a/libstdc++-v3/include/c_std/bits/std_cfloat.h b/libstdc++-v3/include/c_std/bits/std_cfloat.h index e121c8d685a..80f5ea5c4ab 100644 --- a/libstdc++-v3/include/c_std/bits/std_cfloat.h +++ b/libstdc++-v3/include/c_std/bits/std_cfloat.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 18.2.2 Implementation properties: C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CFLOAT #define _CPP_CFLOAT 1 @@ -40,4 +38,3 @@ #include <float.h> #endif - diff --git a/libstdc++-v3/include/c_std/bits/std_climits.h b/libstdc++-v3/include/c_std/bits/std_climits.h index 87406e68d31..48f6acf4d86 100644 --- a/libstdc++-v3/include/c_std/bits/std_climits.h +++ b/libstdc++-v3/include/c_std/bits/std_climits.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 18.2.2 Implementation properties: C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CLIMITS #define _CPP_CLIMITS 1 @@ -40,8 +38,3 @@ #include <limits.h> #endif - - - - - diff --git a/libstdc++-v3/include/c_std/bits/std_clocale.h b/libstdc++-v3/include/c_std/bits/std_clocale.h index 9fb5a1e02a2..02eb8fcc90c 100644 --- a/libstdc++-v3/include/c_std/bits/std_clocale.h +++ b/libstdc++-v3/include/c_std/bits/std_clocale.h @@ -31,13 +31,9 @@ // ISO C++ 14882: 18.2.2 Implementation properties: C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CLOCALE #define _CPP_CLOCALE 1 -#include <bits/c++config.h> - #pragma GCC system_header #include <locale.h> @@ -48,11 +44,8 @@ namespace std { using ::lconv; - extern "C" char* setlocale(int, const char*); - extern "C" struct lconv* localeconv(void); + using ::setlocale; + using ::localeconv; } #endif - - - diff --git a/libstdc++-v3/include/c_std/bits/std_cmath.h b/libstdc++-v3/include/c_std/bits/std_cmath.h index 3648b20a5c6..fedc5fb1a98 100644 --- a/libstdc++-v3/include/c_std/bits/std_cmath.h +++ b/libstdc++-v3/include/c_std/bits/std_cmath.h @@ -31,14 +31,11 @@ // ISO C++ 14882: 26.5 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CMATH #define _CPP_CMATH 1 #include <bits/c++config.h> -#include <bits/std_cstdlib.h> - + #pragma GCC system_header #include <math.h> @@ -64,6 +61,7 @@ #undef pow #undef sin #undef sinh +#undef sqrt #undef tan #undef tanh @@ -80,22 +78,17 @@ namespace std return __x < _Tp() ? -__x : __x; } - inline long - abs(long __i) { return ::labs(__i); } + inline float + abs(float __x) + { return __builtin_fabsf(__x); } - inline ldiv_t - div(long __i, long __j) { return ::ldiv(__i, __j); } + inline double + abs(double __x) + { return __builtin_fabs(__x); } -#if _GLIBCPP_HAVE___BUILTIN_FABSF - inline float - abs(float __x) { return __builtin_fabsf(__x); } -#elif _GLIBCPP_HAVE_FABSF - inline float - abs(float __x) { return ::fabsf(__x); } -#else - inline float - abs(float __x) { return __cmath_abs(__x); } -#endif + inline long double + abs(long double __x) + { return __builtin_fabsl(__x); } #if _GLIBCPP_HAVE_ACOSF inline float @@ -105,6 +98,16 @@ namespace std acos(float __x) { return ::acos(static_cast<double>(__x)); } #endif + using ::acos; + +#if _GLIBCPP_HAVE_ACOSL + inline long double + acos(long double __x) { return ::acosl(__x); } +#else + inline long double + acos(long double __x) { return ::acos(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_ASINF inline float asin(float __x) { return ::asinf(__x); } @@ -113,6 +116,16 @@ namespace std asin(float __x) { return ::asin(static_cast<double>(__x)); } #endif + using ::asin; + +#if _GLIBCPP_HAVE_ASINL + inline long double + asin(long double __x) { return ::asinl(__x); } +#else + inline long double + asin(long double __x) { return ::asin(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_ATANF inline float atan(float __x) { return ::atanf(__x); } @@ -121,6 +134,16 @@ namespace std atan(float __x) { return ::atan(static_cast<double>(__x)); } #endif + using ::atan; + +#if _GLIBCPP_HAVE_ATANL + inline long double + atan(long double __x) { return ::atanl(__x); } +#else + inline long double + atan(long double __x) { return ::atan(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_ATAN2F inline float atan2(float __y, float __x) { return ::atan2f(__y, __x); } @@ -130,6 +153,17 @@ namespace std { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); } #endif + using ::atan2; + +#if _GLIBCPP_HAVE_ATAN2L + inline long double + atan2(long double __y, long double __x) { return ::atan2l(__y, __x); } +#else + inline long double + atan2(long double __y, long double __x) + { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_CEILF inline float ceil(float __x) { return ::ceilf(__x); } @@ -138,17 +172,26 @@ namespace std ceil(float __x) { return ::ceil(static_cast<double>(__x)); } #endif -#if _GLIBCPP_HAVE___BUILTIN_COSF - inline float - cos(float __x) { return __builtin_cosf(__x); } -#elif _GLIBCPP_HAVE_COSF - inline float - cos(float __x) { return ::cosf(__x); } + using ::ceil; + +#if _GLIBCPP_HAVE_CEILL + inline long double + ceil(long double __x) { return ::ceill(__x); } #else - inline float - cos(float __x) { return ::cos(static_cast<double>(__x)); } + inline long double + ceil(long double __x) { return ::ceil(static_cast<double>(__x)); } #endif + inline float + cos(float __x) + { return __builtin_cosf(__x); } + + using ::cos; + + inline long double + cos(long double __x) + { return __builtin_cosl(__x); } + #if _GLIBCPP_HAVE_COSHF inline float cosh(float __x) { return ::coshf(__x); } @@ -157,6 +200,16 @@ namespace std cosh(float __x) { return ::cosh(static_cast<double>(__x)); } #endif + using ::cosh; + +#if _GLIBCPP_HAVE_COSHL + inline long double + cosh(long double __x) { return ::coshl(__x); } +#else + inline long double + cosh(long double __x) { return ::cosh(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_EXPF inline float exp(float __x) { return ::expf(__x); } @@ -165,17 +218,26 @@ namespace std exp(float __x) { return ::exp(static_cast<double>(__x)); } #endif -#if _GLIBCPP_HAVE___BUILTIN_FABSF - inline float - fabs(float __x) { return __builtin_fabsf(__x); } -#elif _GLIBCPP_HAVE_FABSF - inline float - fabs(float __x) { return ::fabsf(__x); } + using ::exp; + +#if _GLIBCPP_HAVE_EXPL + inline long double + exp(long double __x) { return ::expl(__x); } #else - inline float - fabs(float __x) { return __cmath_abs(__x); } + inline long double + exp(long double __x) { return ::exp(static_cast<double>(__x)); } #endif + inline float + fabs(float __x) + { return __builtin_fabsf(__x); } + + using ::fabs; + + inline long double + fabs(long double __x) + { return __builtin_fabsl(__x); } + #if _GLIBCPP_HAVE_FLOORF inline float floor(float __x) { return ::floorf(__x); } @@ -184,6 +246,16 @@ namespace std floor(float __x) { return ::floor(static_cast<double>(__x)); } #endif + using ::floor; + +#if _GLIBCPP_HAVE_FLOORL + inline long double + floor(long double __x) { return ::floorl(__x); } +#else + inline long double + floor(long double __x) { return ::floor(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_FMODF inline float fmod(float __x, float __y) { return ::fmodf(__x, __y); } @@ -193,6 +265,17 @@ namespace std { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); } #endif + using ::fmod; + +#if _GLIBCPP_HAVE_FMODL + inline long double + fmod(long double __x, long double __y) { return ::fmodl(__x, __y); } +#else + inline long double + fmod(long double __x, long double __y) + { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); } +#endif + #if _GLIBCPP_HAVE_FREXPF inline float frexp(float __x, int* __exp) { return ::frexpf(__x, __exp); } @@ -201,6 +284,17 @@ namespace std frexp(float __x, int* __exp) { return ::frexp(__x, __exp); } #endif + using ::frexp; + +#if _GLIBCPP_HAVE_FREXPL + inline long double + frexp(long double __x, int* __exp) { return ::frexpl(__x, __exp); } +#else + inline long double + frexp(long double __x, int* __exp) + { return ::frexp(static_cast<double>(__x), __exp); } +#endif + #if _GLIBCPP_HAVE_LDEXPF inline float ldexp(float __x, int __exp) { return ::ldexpf(__x, __exp); } @@ -210,6 +304,17 @@ namespace std { return ::ldexp(static_cast<double>(__x), __exp); } #endif + using ::ldexp; + +#if _GLIBCPP_HAVE_LDEXPL + inline long double + ldexp(long double __x, int __exp) { return ::ldexpl(__x, __exp); } +#else + inline long double + ldexp(long double __x, int __exp) + { return ::ldexp(static_cast<double>(__x), __exp); } +#endif + #if _GLIBCPP_HAVE_LOGF inline float log(float __x) { return ::logf(__x); } @@ -218,6 +323,16 @@ namespace std { return ::log(static_cast<double>(__x)); } #endif + using ::log; + +#if _GLIBCPP_HAVE_LOGL + inline long double + log(long double __x) { return ::logl(__x); } +#else + inline long double + log(long double __x) { return ::log(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_LOG10F inline float log10(float __x) { return ::log10f(__x); } @@ -226,6 +341,16 @@ namespace std log10(float __x) { return ::log10(static_cast<double>(__x)); } #endif + using ::log10; + +#if _GLIBCPP_HAVE_LOG10L + inline long double + log10(long double __x) { return ::log10l(__x); } +#else + inline long double + log10(long double __x) { return ::log10(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_MODFF inline float modf(float __x, float* __iptr) { return ::modff(__x, __iptr); } @@ -240,6 +365,22 @@ namespace std } #endif + using ::modf; + +#if _GLIBCPP_HAVE_MODFL + inline long double + modf(long double __x, long double* __iptr) { return ::modfl(__x, __iptr); } +#else + inline long double + modf(long double __x, long double* __iptr) + { + double __tmp; + double __res = ::modf(static_cast<double>(__x), &__tmp); + * __iptr = static_cast<long double>(__tmp); + return __res; + } +#endif + template<typename _Tp> inline _Tp __pow_helper(_Tp __x, int __n) @@ -258,23 +399,39 @@ namespace std { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); } #endif - inline float - pow(float __x, int __n) - { - return __pow_helper(__x, __n); - } + using ::pow; -#if _GLIBCPP_HAVE___BUILTIN_SINF - inline float - sin(float __x) { return __builtin_sinf(__x); } -#elif _GLIBCPP_HAVE_SINF - inline float - sin(float __x) { return ::sinf(__x); } +#if _GLIBCPP_HAVE_POWL + inline long double + pow(long double __x, long double __y) { return ::powl(__x, __y); } #else - inline float - sin(float __x) { return ::sin(static_cast<double>(__x)); } + inline long double + pow(long double __x, long double __y) + { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); } #endif + inline float + pow(float __x, int __n) + { return __pow_helper(__x, __n); } + + inline double + pow(double __x, int __i) + { return __pow_helper(__x, __i); } + + inline long double + pow(long double __x, int __n) + { return __pow_helper(__x, __n); } + + inline float + sin(float __x) + { return __builtin_sinf(__x); } + + using ::sin; + + inline long double + sin(long double __x) + { return __builtin_sinl(__x); } + #if _GLIBCPP_HAVE_SINHF inline float sinh(float __x) { return ::sinhf(__x); } @@ -283,17 +440,26 @@ namespace std sinh(float __x) { return ::sinh(static_cast<double>(__x)); } #endif -#if _GLIBCPP_HAVE___BUILTIN_SQRTF - inline float - sqrt(float __x) { return __builtin_sqrtf(__x); } -#elif _GLIBCPP_HAVE_SQRTF - inline float - sqrt(float __x) { return ::sqrtf(__x); } + using ::sinh; + +#if _GLIBCPP_HAVE_SINHL + inline long double + sinh(long double __x) { return ::sinhl(__x); } #else - inline float - sqrt(float __x) { return ::sqrt(static_cast<double>(__x)); } + inline long double + sinh(long double __x) { return ::sinh(static_cast<double>(__x)); } #endif + inline float + sqrt(float __x) + { return __builtin_sqrtf(__x); } + + using ::sqrt; + + inline long double + sqrt(long double __x) + { return __builtin_sqrtl(__x); } + #if _GLIBCPP_HAVE_TANF inline float tan(float __x) { return ::tanf(__x); } @@ -302,6 +468,16 @@ namespace std tan(float __x) { return ::tan(static_cast<double>(__x)); } #endif + using ::tan; + +#if _GLIBCPP_HAVE_TANL + inline long double + tan(long double __x) { return ::tanl(__x); } +#else + inline long double + tan(long double __x) { return ::tan(static_cast<double>(__x)); } +#endif + #if _GLIBCPP_HAVE_TANHF inline float tanh(float __x) { return ::tanhf(__x); } @@ -310,306 +486,171 @@ namespace std tanh(float __x) { return ::tanh(static_cast<double>(__x)); } #endif + using ::tanh; - extern "C" double acos(double __x); - - extern "C" double asin(double __x); - - extern "C" double atan(double __x); - - extern "C" double atan2(double __y, double __x); - - extern "C" double ceil(double __x); - -#if _GLIBCPP_HAVE___BUILTIN_COS - inline double - cos(double __x) { return __builtin_cos(__x); } -#else - extern "C" double cos(double __x); -#endif - - extern "C" double cosh(double __x); - - extern "C" double exp(double __x); - -#if _GLIBCPP_HAVE___BUILTIN_FABS - inline double - fabs(double __x) { return __builtin_fabs(__x); } -#else - extern "C" double fabs(double __x); -#endif - -#if _GLIBCPP_HAVE___BUILTIN_FABS - inline double - abs(double __x) { return __builtin_fabs(__x); } -#else - inline double - abs(double __x) { return fabs(__x); } -#endif - - extern "C" double floor(double __x); - - extern "C" double fmod(double __x, double __y); - - extern "C" double frexp(double __x, int* __exp); - - extern "C" double ldexp(double __x, int __exp); - - extern "C" double log(double __x); - - extern "C" double log10(double __x); - - extern "C" double modf(double __x, double* __iptr); - - extern "C" double pow(double __x, double __y); - - inline double - pow(double __x, int __i) - { - return __pow_helper(__x, __i); - } - -#if _GLIBCPP_HAVE___BUILTIN_SIN - inline double - sin(double __x) { return __builtin_sin(__x); } -#else - extern "C" double sin(double __x); -#endif - - extern "C" double sinh(double __x); - -#if _GLIBCPP_HAVE___BUILTIN_SQRT - inline double - sqrt(double __x) { return __builtin_fsqrt(__x); } -#else - extern "C" double sqrt(double __x); -#endif - - extern "C" double tan(double __x); - - extern "C" double tanh(double __x); - - -#if _GLIBCPP_HAVE___BUILTIN_FABSL - inline long double - abs(long double __x) { return __builtin_fabsl(__x); } -#elif _GLIBCPP_HAVE_FABSL +#if _GLIBCPP_HAVE_TANHL inline long double - abs(long double __x) { return ::fabsl(__x); } + tanh(long double __x) { return ::tanhl(__x); } #else inline long double - abs(long double __x) { return __cmath_abs(__x); } + tanh(long double __x) { return ::tanh(static_cast<double>(__x)); } #endif +} -#if _GLIBCPP_HAVE_ACOSL - inline long double - acos(long double __x) { return ::acosl(__x); } -#else - inline long double - acos(long double __x) { return ::acos(static_cast<double>(__x)); } -#endif -#if _GLIBCPP_HAVE_ASINL - inline long double - asin(long double __x) { return ::asinl(__x); } -#else - inline long double - asin(long double __x) { return ::asin(static_cast<double>(__x)); } -#endif +#if _GLIBCPP_USE_C99 +// 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 +{ + template<typename _Tp> + int + __capture_fpclassify(_Tp __f) { return fpclassify(__f); } -#if _GLIBCPP_HAVE_ATANL - inline long double - atan(long double __x) { return ::atanl(__x); } -#else - inline long double - atan(long double __x) { return ::atan(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isfinite(_Tp __f) { return isfinite(__f); } -#if _GLIBCPP_HAVE_ATAN2L - inline long double - atan2(long double __y, long double __x) { return ::atan2l(__y, __x); } -#else - inline long double - atan2(long double __y, long double __x) - { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isinf(_Tp __f) { return isinf(__f); } -#if _GLIBCPP_HAVE_CEILL - inline long double - ceil(long double __x) { return ::ceill(__x); } -#else - inline long double - ceil(long double __x) { return ::ceil(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isnan(_Tp __f) { return isnan(__f); } -#if _GLIBCPP_HAVE___BUILTIN_COSL - inline long double - cos(long double __x) { return __builtin_cosl(__x); } -#elif _GLIBCPP_HAVE_COSL - inline long double - cos(long double __x) { return ::cosl(__x); } -#else - inline long double - cos(long double __x) { return ::cos(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isnormal(_Tp __f) { return isnormal(__f); } -#if _GLIBCPP_HAVE_COSHL - inline long double - cosh(long double __x) { return ::coshl(__x); } -#else - inline long double - cosh(long double __x) { return ::cosh(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_signbit(_Tp __f) { return signbit(__f); } -#if _GLIBCPP_HAVE_EXPL - inline long double - exp(long double __x) { return ::expl(__x); } -#else - inline long double - exp(long double __x) { return ::exp(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isgreater(_Tp __f1, _Tp __f2) + { return isgreater(__f1, __f2); } -#if _GLIBCPP_HAVE___BUILTIN_FABSL - inline long double - fabs(long double __x) { return __builtin_fabsl(__x); } -#elif _GLIBCPP_HAVE_FABSL - inline long double - fabs(long double __x) { return ::fabsl(__x); } -#else - inline long double - fabs(long double __x) { return __cmath_abs(__x); } -#endif + template<typename _Tp> + int + __capture_isgreaterequal(_Tp __f1, _Tp __f2) + { return isgreaterequal(__f1, __f2); } -#if _GLIBCPP_HAVE_FLOORL - inline long double - floor(long double __x) { return ::floorl(__x); } -#else - inline long double - floor(long double __x) { return ::floor(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); } -#if _GLIBCPP_HAVE_FMODL - inline long double - fmod(long double __x, long double __y) { return ::fmodl(__x, __y); } -#else - inline long double - fmod(long double __x, long double __y) - { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); } -#endif + template<typename _Tp> + int + __capture_islessequal(_Tp __f1, _Tp __f2) + { return islessequal(__f1, __f2); } -#if _GLIBCPP_HAVE_FREXPL - inline long double - frexp(long double __x, int* __exp) { return ::frexpl(__x, __exp); } -#else - inline long double - frexp(long double __x, int* __exp) - { return ::frexp(static_cast<double>(__x), __exp); } -#endif + template<typename _Tp> + int + __capture_islessgreater(_Tp __f1, _Tp __f2) + { return islessgreater(__f1, __f2); } -#if _GLIBCPP_HAVE_LDEXPL - inline long double - ldexp(long double __x, int __exp) { return ::ldexpl(__x, __exp); } -#else - inline long double - ldexp(long double __x, int __exp) - { return ::ldexp(static_cast<double>(__x), __exp); } -#endif + template<typename _Tp> + int + __capture_isunordered(_Tp __f1, _Tp __f2) + { return isunordered(__f1, __f2); } +} +#endif + +#undef fpclassify +#undef isfinite +#undef isinf +#undef isnan +#undef isnormal +#undef signbit +#undef isgreater +#undef isgreaterequal +#undef isless +#undef islessequal +#undef islessgreater +#undef isunordered + +#if _GLIBCPP_USE_C99 +namespace __gnu_cxx +{ + template<typename _Tp> + int + fpclassify(_Tp __f) { return __capture_fpclassify(__f); } -#if _GLIBCPP_HAVE_LOGL - inline long double - log(long double __x) { return ::logl(__x); } -#else - inline long double - log(long double __x) { return ::log(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + isfinite(_Tp __f) { return __capture_isfinite(__f); } -#if _GLIBCPP_HAVE_LOG10L - inline long double - log10(long double __x) { return ::log10l(__x); } -#else - inline long double - log10(long double __x) { return ::log10(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + isinf(_Tp __f) { return __capture_isinf(__f); } -#if _GLIBCPP_HAVE_MODFL - inline long double - modf(long double __x, long double* __iptr) { return ::modfl(__x, __iptr); } -#else - inline long double - modf(long double __x, long double* __iptr) - { - double __tmp; - double __res = ::modf(static_cast<double>(__x), &__tmp); - * __iptr = static_cast<long double>(__tmp); - return __res; - } -#endif + template<typename _Tp> + int + isnan(_Tp __f) { return __capture_isnan(__f); } -#if _GLIBCPP_HAVE_POWL - inline long double - pow(long double __x, long double __y) { return ::powl(__x, __y); } -#else - inline long double - pow(long double __x, long double __y) - { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); } -#endif + template<typename _Tp> + int + isnormal(_Tp __f) { return __capture_isnormal(__f); } - inline long double - pow(long double __x, int __n) - { - return __pow_helper(__x, __n); - } + template<typename _Tp> + int + signbit(_Tp __f) { return __capture_signbit(__f); } -#if _GLIBCPP_HAVE___BUILTIN_SINL - inline long double - sin(long double __x) { return __builtin_sinl(__x); } -#elif _GLIBCPP_HAVE_SINL - inline long double - sin(long double __x) { return ::sinl(__x); } -#else - inline long double - sin(long double __x) { return ::sin(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); } -#if _GLIBCPP_HAVE_SINHL - inline long double - sinh(long double __x) { return ::sinhl(__x); } -#else - inline long double - sinh(long double __x) { return ::sinh(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + isgreaterequal(_Tp __f1, _Tp __f2) + { return __capture_isgreaterequal(__f1, __f2); } -#if _GLIBCPP_HAVE___BUILTIN_SQRTL - inline long double - sqrt(long double __x) { return __builtin_sqrtl(__x); } -#elif _GLIBCPP_HAVE_SQRTL - inline long double - sqrt(long double __x) { return ::sqrtl(__x); } -#else - inline long double - sqrt(long double __x) { return ::sqrt(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); } -#if _GLIBCPP_HAVE_TANL - inline long double - tan(long double __x) { return ::tanl(__x); } -#else - inline long double - tan(long double __x) { return ::tan(static_cast<double>(__x)); } -#endif + template<typename _Tp> + int + islessequal(_Tp __f1, _Tp __f2) + { return __capture_islessequal(__f1, __f2); } -#if _GLIBCPP_HAVE_TANHL - inline long double - tanh(long double __x) { return ::tanhl(__x); } -#else - inline long double - tanh(long double __x) { return ::tanh(static_cast<double>(__x)); } -#endif -} // std + template<typename _Tp> + int + islessgreater(_Tp __f1, _Tp __f2) + { return __capture_islessgreater(__f1, __f2); } + + template<typename _Tp> + 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; +} +#endif + #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export # include <bits/cmath.tcc> #endif #endif + + + diff --git a/libstdc++-v3/include/c_std/bits/std_csetjmp.h b/libstdc++-v3/include/c_std/bits/std_csetjmp.h index b8c319ce0a7..5db98e7b97e 100644 --- a/libstdc++-v3/include/c_std/bits/std_csetjmp.h +++ b/libstdc++-v3/include/c_std/bits/std_csetjmp.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 20.4.6 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSETJMP #define _CPP_CSETJMP 1 @@ -42,10 +40,15 @@ // Get rid of those macros defined in <setjmp.h> in lieu of real functions. #undef longjmp +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef setjmp +#define setjmp(env) setjmp (env) +#endif + namespace std { using ::jmp_buf; - extern "C" void longjmp(jmp_buf, int); + using ::longjmp; } #endif diff --git a/libstdc++-v3/include/c_std/bits/std_csignal.h b/libstdc++-v3/include/c_std/bits/std_csignal.h index 437590f7f38..818e7bbbc9c 100644 --- a/libstdc++-v3/include/c_std/bits/std_csignal.h +++ b/libstdc++-v3/include/c_std/bits/std_csignal.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 20.4.6 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSIGNAL #define _CPP_CSIGNAL 1 @@ -45,8 +43,8 @@ namespace std { using ::sig_atomic_t; - extern "C" void (*signal(int, void (*__func)(int)))(int); - extern "C" int raise(int); + using ::signal; + using ::raise; } #endif diff --git a/libstdc++-v3/include/c_std/bits/std_cstdarg.h b/libstdc++-v3/include/c_std/bits/std_cstdarg.h index 39018be29f2..58faa3b9876 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdarg.h +++ b/libstdc++-v3/include/c_std/bits/std_cstdarg.h @@ -31,14 +31,17 @@ // ISO C++ 14882: 20.4.6 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSTDARG #define _CPP_CSTDARG 1 #pragma GCC system_header #include <stdarg.h> +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef va_end +#define va_end(ap) va_end (ap) +#endif + namespace std { using ::va_list; diff --git a/libstdc++-v3/include/c_std/bits/std_cstddef.h b/libstdc++-v3/include/c_std/bits/std_cstddef.h index d03c899b27e..deb2db4448c 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstddef.h +++ b/libstdc++-v3/include/c_std/bits/std_cstddef.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 18.1 Types // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSTDDEF #define _CPP_CSTDDEF 1 diff --git a/libstdc++-v3/include/c_std/bits/std_cstdio.h b/libstdc++-v3/include/c_std/bits/std_cstdio.h index ba731a6af28..a4c67d22acd 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdio.h +++ b/libstdc++-v3/include/c_std/bits/std_cstdio.h @@ -31,125 +31,131 @@ // ISO C++ 14882: 27.8.2 C Library files // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSTDIO #define _CPP_CSTDIO 1 #include <bits/c++config.h> -#include <bits/std_cstdarg.h> #include <bits/std_cstddef.h> #pragma GCC system_header #include <stdio.h> // Get rid of those macros defined in <stdio.h> in lieu of real functions. -#undef remove -#undef rename -#undef tmpfile -#undef tmpnam +#undef clearerr #undef fclose +#undef feof +#undef ferror #undef fflush -#undef fopen -#undef freopen -#undef setbuf -#undef setvbuf -#undef fprintf -#undef fscanf -#undef printf -#undef scanf -#undef snprintf -#undef sprintf -#undef sscanf -#undef vfprintf -#undef vfscanf -#undef vprintf -#undef vscanf -#undef vsnprintf -#undef vsprintf -#undef vsscanf #undef fgetc +#undef fgetpos #undef fgets +#undef fopen +#undef fprintf #undef fputc #undef fputs +#undef fread +#undef freopen +#undef fscanf +#undef fseek +#undef fsetpos +#undef ftell +#undef fwrite #undef getc #undef getchar #undef gets +#undef perror +#undef printf #undef putc #undef putchar #undef puts -#undef ungetc -#undef fread -#undef fwrite -#undef fgetpos -#undef fseek -#undef fsetpos -#undef ftell +#undef remove +#undef rename #undef rewind -#undef clearerr -#undef feof -#undef ferror -#undef perror +#undef scanf +#undef setbuf +#undef setvbuf +#undef sprintf +#undef sscanf +#undef tmpfile +#undef tmpnam +#undef ungetc +#undef vfprintf +#undef vprintf +#undef vsprintf namespace std { using ::FILE; using ::fpos_t; - extern "C" int remove(const char*); - extern "C" int rename(const char*, const char*); - extern "C" FILE* tmpfile(void); - extern "C" char* tmpnam(char*); - extern "C" int fclose(FILE*); - extern "C" int fflush(FILE*); - extern "C" FILE* fopen(const char*, const char*); - extern "C" FILE* freopen(const char*, const char*, FILE*); - extern "C" void setbuf(FILE*, char*); - extern "C" int setvbuf(FILE*, char*, int, size_t); - extern "C" int fprintf(FILE*, const char*, ...); - extern "C" int fscanf(FILE*, const char*, ...); - extern "C" int printf(const char*, ...); - extern "C" int scanf(const char*, ...); - extern "C" int snprintf(char *, size_t, const char*, ...); - extern "C" int sprintf(char *, const char*, ...); - extern "C" int sscanf(const char*, const char*, ...); - extern "C" int vfprintf(FILE*, const char*, va_list); - extern "C" int vfscanf(FILE*, const char*, va_list); - extern "C" int vprintf(const char*, va_list); - extern "C" int vscanf(const char*, va_list); - extern "C" int vsnprintf(char*, size_t, const char*, va_list); - extern "C" int vsprintf(char*, const char*, va_list); - extern "C" int vsscanf(const char*, const char*, va_list); - extern "C" int fgetc(FILE *); - extern "C" char *fgets(char*, int, FILE*); - extern "C" int fputc(int, FILE*); - extern "C" int fputs(const char*, FILE*); - extern "C" int getc(FILE*); - extern "C" int getchar(void); - extern "C" char *gets(char*); - extern "C" int putc(int, FILE*); - extern "C" int putchar(int); - extern "C" int puts(const char*); - extern "C" int ungetc(int, FILE*); - extern "C" size_t fread(void*, size_t, size_t, FILE*); - extern "C" size_t fwrite(const void*, size_t, size_t, FILE*); - extern "C" int fgetpos(FILE*, fpos_t*); - extern "C" int fseek(FILE*, long int, int); - extern "C" int fsetpos(FILE*, const fpos_t*); - extern "C" long int ftell(FILE*); - extern "C" void rewind(FILE*); - extern "C" void clearerr(FILE*); - extern "C" int feof(FILE*); - extern "C" int ferror(FILE*); - extern "C" void perror(const char*); + using ::clearerr; + using ::fclose; + using ::feof; + using ::ferror; + using ::fflush; + using ::fgetc; + using ::fgetpos; + using ::fgets; + using ::fopen; + using ::fprintf; + using ::fputc; + using ::fputs; + using ::fread; + using ::freopen; + using ::fscanf; + using ::fseek; + using ::fsetpos; + using ::ftell; + using ::fwrite; + using ::getc; + using ::getchar; + using ::gets; + using ::perror; + using ::printf; + using ::putc; + using ::putchar; + using ::puts; + using ::remove; + using ::rename; + using ::rewind; + using ::scanf; + using ::setbuf; + using ::setvbuf; + using ::sprintf; + using ::sscanf; + using ::tmpfile; + using ::tmpnam; + using ::ungetc; + using ::vfprintf; + using ::vprintf; + using ::vsprintf; } -#endif - - - - +#if _GLIBCPP_USE_C99 +#undef snprintf +#undef vfscanf +#undef vscanf +#undef vsnprintf +#undef vsscanf +namespace __gnu_cxx +{ + using ::snprintf; + using ::vfscanf; + using ::vscanf; + using ::vsnprintf; + using ::vsscanf; +} +namespace std +{ + using __gnu_cxx::snprintf; + using __gnu_cxx::vfscanf; + using __gnu_cxx::vscanf; + using __gnu_cxx::vsnprintf; + using __gnu_cxx::vsscanf; +} +#endif +#endif diff --git a/libstdc++-v3/include/c_std/bits/std_cstdlib.h b/libstdc++-v3/include/c_std/bits/std_cstdlib.h index 5ee0b7e9b6e..b67ce44f937 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdlib.h +++ b/libstdc++-v3/include/c_std/bits/std_cstdlib.h @@ -31,8 +31,6 @@ // ISO C++ 14882: 20.4.6 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSTDLIB #define _CPP_CSTDLIB 1 @@ -43,94 +41,92 @@ #include <stdlib.h> // Get rid of those macros defined in <stdlib.h> in lieu of real functions. +#undef abort +#undef abs +#undef atexit #undef atof #undef atoi #undef atol -#undef strtod -#undef strtof -#undef strtol -#undef strtoul -#undef rand -#undef srand +#undef bsearch #undef calloc -#undef free -#undef malloc -#undef realloc -#undef abort -#undef atexit +#undef div #undef exit -#undef _Exit +#undef free #undef getenv -#undef system -#undef bsearch -#undef qsort -#undef abs #undef labs -#undef llabs -#undef div #undef ldiv -#undef lldiv +#undef malloc #undef mblen -#undef mbtowc -#undef wctomb #undef mbstowcs +#undef mbtowc +#undef qsort +#undef rand +#undef realloc +#undef srand +#undef strtod +#undef strtol +#undef strtoul +#undef system #undef wcstombs -#undef atoll -#undef strtoll -#undef strtoull -#undef strtold +#undef wctomb namespace std { using ::div_t; using ::ldiv_t; -#ifdef _GLIBCPP_USE_LONG_LONG -# ifdef _GLIBCPP_HAVE_LLDIV_T + using ::abort; + using ::abs; + using ::atexit; + using ::atof; + using ::atoi; + using ::atol; + using ::bsearch; + using ::calloc; + using ::div; + using ::exit; + using ::free; + using ::getenv; + using ::labs; + using ::ldiv; + using ::malloc; + using ::mblen; + using ::mbstowcs; + using ::mbtowc; + using ::qsort; + using ::rand; + using ::realloc; + using ::srand; + using ::strtod; + using ::strtol; + using ::strtoul; + using ::system; + using ::wcstombs; + using ::wctomb; + + inline long + abs(long __i) { return labs(__i); } + + inline ldiv_t + div(long __i, long __j) { return ldiv(__i, __j); } +} + +#if _GLIBCPP_USE_C99 + +#undef _Exit +#undef llabs +#undef lldiv +#undef atoll +#undef strtoll +#undef strtoull +#undef strtof +#undef strtold + +namespace __gnu_cxx +{ using ::lldiv_t; -# else - struct lldiv_t - { - long long quot; - long long rem; - }; -# endif -#endif + using ::_Exit; - extern "C" double atof(const char*); - extern "C" int atoi(const char*); - extern "C" long int atol(const char*); - extern "C" double strtod(const char*, char**); - extern "C" float strtof(const char*, char**); - extern "C" long int strtol(const char*, char**, int); - extern "C" unsigned long int strtoul(const char*, char**, int); - extern "C" int rand(void); - extern "C" void srand(unsigned int); - extern "C" void* calloc(size_t, size_t); - extern "C" void free(void*); - extern "C" void* malloc(size_t); - extern "C" void* realloc(void*, size_t); - extern "C" void abort(void); - extern "C" int atexit(void (*func)(void)); - extern "C" void exit(int); - extern "C" void _Exit(int); - extern "C" char*getenv(const char*); - extern "C" int system(const char*); - extern "C" void* bsearch(const void*, const void*, size_t, size_t, - int (*comp)(const void *, const void *)); - extern "C" void qsort(void*, size_t, size_t, - int (*comp)(const void *, const void *)); - extern "C" int abs(int); - extern "C" long int labs(long int); - extern "C" div_t div(int, int); - extern "C" ldiv_t ldiv(long int, long int); - extern "C" int mblen(const char*, size_t); - extern "C" int mbtowc(wchar_t*, const char*, size_t); - extern "C" int wctomb(char*, wchar_t); - extern "C" size_t mbstowcs(wchar_t*, const char*, size_t); - extern "C" size_t wcstombs(char*, const wchar_t*, size_t); - -#ifdef _GLIBCPP_USE_LONG_LONG inline long long abs(long long __x) { return __x >= 0 ? __x : -__x; } @@ -145,21 +141,27 @@ namespace std lldiv(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } - extern "C" long long int atoll(const char*); - extern "C" long long int strtoll(const char*, char**, int); - extern "C" unsigned long long int strtoull(const char*, char**, int); -#endif + using ::atoll; + using ::strtof; + using ::strtoll; + using ::strtoull; + using ::strtold; +} -#ifdef _GLIBCPP_HAVE_STRTOLD - extern "C" long double strtold(const char*, char**); -#endif +namespace std +{ + using __gnu_cxx::lldiv_t; + using __gnu_cxx::_Exit; + using __gnu_cxx::abs; + using __gnu_cxx::llabs; + using __gnu_cxx::div; + using __gnu_cxx::lldiv; + using __gnu_cxx::atoll; + using __gnu_cxx::strtof; + using __gnu_cxx::strtoll; + using __gnu_cxx::strtoull; + using __gnu_cxx::strtold; } +#endif #endif - - - - - - - diff --git a/libstdc++-v3/include/c_std/bits/std_cstring.h b/libstdc++-v3/include/c_std/bits/std_cstring.h index 7429e6570e2..ab6a6a66c4d 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstring.h +++ b/libstdc++-v3/include/c_std/bits/std_cstring.h @@ -31,12 +31,9 @@ // ISO C++ 14882: 20.4.6 C library // -// Note: This is not a conforming implementation. - #ifndef _CPP_CSTRING #define _CPP_CSTRING 1 -#include <bits/c++config.h> #include <bits/std_cstddef.h> #pragma GCC system_header @@ -68,31 +65,53 @@ namespace std { - extern "C" void* memcpy(void*, const void*, size_t); - extern "C" void* memmove(void*, const void*, size_t); - extern "C" char* strcpy(char*, const char*); - extern "C" char* strncpy(char*, const char*, size_t); - extern "C" char* strcat(char*, const char*); - extern "C" char* strncat(char*, const char*, size_t); - extern "C" int memcmp(const void*, const void*, size_t); - extern "C" int strcmp(const char*, const char*); - extern "C" int strcoll(const char*, const char*); - extern "C" int strncmp(const char*, const char*, size_t); - extern "C" size_t strxfrm(char*, const char*, size_t); - extern "C" void* memchr(const void*, int, size_t); - extern "C" char* strchr(const char*, int); - extern "C" size_t strcspn(const char*, const char*); - extern "C" char* strpbrk(const char*, const char*); - extern "C" char* strrchr(const char*, int); - extern "C" size_t strspn(const char*, const char*); - extern "C" char* strstr(const char*, const char*); - extern "C" char* strtok(char*, const char*); - extern "C" void* memset(void*, int, size_t); - extern "C" char* strerror(int); - extern "C" size_t strlen(const char*); -} + using ::memcpy; + using ::memmove; + using ::strcpy; + using ::strncpy; + using ::strcat; + using ::strncat; + using ::memcmp; + using ::strcmp; + using ::strcoll; + using ::strncmp; + using ::strxfrm; + using ::strcspn; + using ::strspn; + using ::strtok; + using ::memset; + using ::strerror; + using ::strlen; -#endif + using ::memchr; + + inline void* + memchr(void* __p, int __c, size_t __n) + { return memchr(const_cast<const void*>(__p), __c, __n); } + + using ::strchr; + + inline char* + strchr(char* __s1, int __n) + { return __builtin_strchr(const_cast<const char*>(__s1), __n); } + using ::strpbrk; + inline char* + strpbrk(char* __s1, const char* __s2) + { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); } + using ::strrchr; + + inline char* + strrchr(char* __s1, int __n) + { return __builtin_strrchr(const_cast<const char*>(__s1), __n); } + + using ::strstr; + + inline char* + strstr(char* __s1, const char* __s2) + { return __builtin_strstr(const_cast<const char*>(__s1), __s2); } +} + +#endif diff --git a/libstdc++-v3/include/c_std/bits/std_ctime.h b/libstdc++-v3/include/c_std/bits/std_ctime.h index d4bb28d50d2..a9051b49735 100644 --- a/libstdc++-v3/include/c_std/bits/std_ctime.h +++ b/libstdc++-v3/include/c_std/bits/std_ctime.h @@ -31,12 +31,9 @@ // ISO C++ 14882: 20.5 Date and time // -// Note: This is not a conforming implementation. - #ifndef _CPP_CTIME #define _CPP_CTIME 1 -#include <bits/c++config.h> #include <bits/std_cstddef.h> #pragma GCC system_header @@ -59,15 +56,15 @@ namespace std using ::time_t; using ::tm; - extern "C" clock_t clock(void); - extern "C" double difftime(time_t, time_t); - extern "C" time_t mktime(struct tm*); - extern "C" time_t time(time_t*); - extern "C" char* asctime(const struct tm*); - extern "C" char* ctime(const time_t*); - extern "C" struct tm* gmtime(const time_t*); - extern "C" struct tm* localtime(const time_t*); - extern "C" size_t strftime(char*, size_t, const char*, const struct tm*); + using ::clock; + using ::difftime; + using ::mktime; + using ::time; + using ::asctime; + using ::ctime; + using ::gmtime; + using ::localtime; + using ::strftime; } #endif diff --git a/libstdc++-v3/include/c_std/bits/std_cwchar.h b/libstdc++-v3/include/c_std/bits/std_cwchar.h index d2ac5bbdda3..b19cfeaadc2 100644 --- a/libstdc++-v3/include/c_std/bits/std_cwchar.h +++ b/libstdc++-v3/include/c_std/bits/std_cwchar.h @@ -28,25 +28,21 @@ // the GNU General Public License. // -// ISO C++ 14882: ??? +// ISO C++ 14882: 21.4 // -// Note: This is not a conforming implementation. - #ifndef _CPP_CWCHAR #define _CPP_CWCHAR 1 #include <bits/c++config.h> #include <bits/std_cstddef.h> -#include <bits/std_cstdio.h> -#include <bits/std_cstdarg.h> +#include <bits/std_ctime.h> #if _GLIBCPP_HAVE_WCHAR_H #pragma GCC system_header #include <wchar.h> #endif - // Need to do a bit of trickery here with mbstate_t as char_traits // assumes it is in wchar.h, regardless of wchar_t specializations. #ifndef _GLIBCPP_HAVE_MBSTATE_T @@ -65,121 +61,172 @@ namespace std } // Get rid of those macros defined in <wchar.h> in lieu of real functions. -#undef vwprintf -#undef vwscanf -#undef wprintf -#undef wscanf +#undef btowc +#undef fgetwc +#undef fgetws +#undef fputwc +#undef fputws +#undef fwide +#undef fwprintf +#undef fwscanf #undef getwc #undef getwchar -#undef mbsinit #undef mbrlen #undef mbrtowc +#undef mbsinit #undef mbsrtowcs -#undef wcsrtombs #undef putwc #undef putwchar +#undef swprintf +#undef swscanf #undef ungetwc +#undef vfwprintf +#undef vfwscanf +#undef vswprintf +#undef vswscanf +#undef vwprintf +#undef vwscanf #undef wcrtomb -#undef wcstod -#undef wcstof -#undef wcstol -#undef wcstoul -#undef wcscpy -#undef wcsncpy #undef wcscat -#undef wcsncat +#undef wcschr #undef wcscmp #undef wcscoll -#undef wcsncmp -#undef wcsxfrm -#undef wcschr +#undef wcscpy #undef wcscspn +#undef wcsftime #undef wcslen +#undef wcsncat +#undef wcsncmp +#undef wcsncpy #undef wcspbrk #undef wcsrchr +#undef wcsrtombs #undef wcsspn #undef wcsstr +#undef wcstod +#undef wcstof #undef wcstok +#undef wcstol +#undef wcstoul +#undef wcsxfrm +#undef wctob #undef wmemchr #undef wmemcmp #undef wmemcpy #undef wmemmove #undef wmemset -#undef wcsftime -#undef wcstold -#undef wcstoll -#undef wcstoull +#undef wprintf +#undef wscanf #if _GLIBCPP_USE_WCHAR_T namespace std { using ::wint_t; - extern "C" wint_t btowc(int); - extern "C" int wctob(wint_t); - extern "C" wint_t fgetwc(FILE*); - extern "C" wchar_t* fgetws(wchar_t*, int, FILE*); - extern "C" wint_t fputwc(wchar_t, FILE*); - extern "C" int fputws(const wchar_t*, FILE*); - extern "C" int fwide(FILE*, int); - extern "C" int fwprintf(FILE*, const wchar_t*, ...); - extern "C" int fwscanf(FILE*, const wchar_t*, ...); - extern "C" int swprintf(wchar_t*, size_t, const wchar_t*, ...); - extern "C" int swscanf(const wchar_t*, const wchar_t*, ...); - extern "C" int vfwprintf(FILE*, const wchar_t*, va_list); - extern "C" int vfwscanf(FILE*, const wchar_t*, va_list); - extern "C" int vswprintf(wchar_t*, size_t, const wchar_t*, va_list); - extern "C" int vswscanf(const wchar_t*, const wchar_t*, va_list); - extern "C" int vwprintf(const wchar_t*, va_list); - extern "C" int vwscanf(const wchar_t*, va_list); - extern "C" int wprintf(const wchar_t*, ...); - extern "C" int wscanf(const wchar_t*, ...); - extern "C" wint_t getwc(FILE* stream); - extern "C" wint_t getwchar(void); - extern "C" int mbsinit(const mbstate_t*); - extern "C" size_t mbrlen(const char*, size_t, mbstate_t*); - extern "C" size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*); - extern "C" size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*); - extern "C" size_t wcsrtombs(char*, const wchar_t **, size_t, mbstate_t*); - extern "C" wint_t putwc(wchar_t, FILE*); - extern "C" wint_t putwchar(wchar_t); - extern "C" wint_t ungetwc(wint_t, FILE*); - extern "C" size_t wcrtomb(char*, wchar_t, mbstate_t*); - extern "C" double wcstod(const wchar_t*, wchar_t**); - extern "C" float wcstof(const wchar_t*, wchar_t**); - extern "C" long int wcstol(const wchar_t*, wchar_t**, int); - extern "C" unsigned long int wcstoul(const wchar_t*, wchar_t**, int); - extern "C" wchar_t* wcscpy(wchar_t* s1, const wchar_t*); - extern "C" wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t); - extern "C" wchar_t* wcscat(wchar_t*, const wchar_t*); - extern "C" wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t); - extern "C" int wcscmp(const wchar_t*, const wchar_t*); - extern "C" int wcscoll(const wchar_t*, const wchar_t*); - extern "C" int wcsncmp(const wchar_t*, const wchar_t*, size_t); - extern "C" size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); - extern "C" wchar_t* wcschr(const wchar_t*, wchar_t); - extern "C" size_t wcscspn(const wchar_t*, const wchar_t*); - extern "C" size_t wcslen(const wchar_t*); - extern "C" wchar_t* wcspbrk(const wchar_t*, const wchar_t*); - extern "C" wchar_t* wcsrchr(const wchar_t*, wchar_t); - extern "C" size_t wcsspn(const wchar_t*, const wchar_t*); - extern "C" wchar_t* wcsstr(const wchar_t*, const wchar_t*); - extern "C" wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**); - extern "C" wchar_t* wmemchr(const wchar_t*, wchar_t, size_t); - extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t); - //extern "C" int wmemcmp(wchar_t*, const wchar_t*, size_t); - extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t); - extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t); - extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t); - extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*); - -#if 0 - // Full C99 listing - extern "C" long double wcstold(const wchar_t*, wchar_t**); - extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int); - extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int); -#endif + using ::btowc; + using ::fgetwc; + using ::fgetws; + using ::fputwc; + using ::fputws; + using ::fwide; + using ::fwprintf; + using ::fwscanf; + using ::getwc; + using ::getwchar; + using ::mbrlen; + using ::mbrtowc; + using ::mbsinit; + using ::mbsrtowcs; + using ::putwc; + using ::putwchar; + using ::swprintf; + using ::swscanf; + using ::ungetwc; + using ::vfwprintf; + using ::vfwscanf; + using ::vswprintf; + using ::vswscanf; + using ::vwprintf; + using ::vwscanf; + using ::wcrtomb; + using ::wcscat; + using ::wcscmp; + using ::wcscoll; + using ::wcscpy; + using ::wcscspn; + using ::wcsftime; + using ::wcslen; + using ::wcsncat; + using ::wcsncmp; + using ::wcsncpy; + using ::wcsrtombs; + using ::wcsspn; + using ::wcstod; + using ::wcstof; + using ::wcstok; + using ::wcstol; + using ::wcstoul; + using ::wcsxfrm; + using ::wctob; + using ::wmemcmp; + using ::wmemcpy; + using ::wmemmove; + using ::wmemset; + using ::wprintf; + using ::wscanf; + + using ::wcschr; + + inline wchar_t* + wcschr(wchar_t* __p, wchar_t __c) + { return wcschr(const_cast<const wchar_t*>(__p), __c); } + + using ::wcspbrk; + + inline wchar_t* + wcspbrk(wchar_t* __s1, wchar_t* __s2) + { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); } + + using ::wcsrchr; + + inline wchar_t* + wcsrchr(wchar_t* __p, wchar_t __c) + { return wcsrchr(const_cast<const wchar_t*>(__p), __c); } + + using ::wcsstr; + + inline wchar_t* + wcsstr(wchar_t* __s1, wchar_t* __s2) + { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); } + + using ::wmemchr; + + inline wchar_t* + wmemchr(wchar_t* __p, wchar_t __c, size_t __n) + { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); } } + +#if _GLIBCPP_USE_C99 + +#undef wcstold +#undef wcstoll +#undef wcstoull + +namespace __gnu_cxx +{ + using ::wcstold; + using ::wcstoll; + using ::wcstoull; +} + +namespace std +{ + using __gnu_cxx::wcstold; + using __gnu_cxx::wcstoll; + using __gnu_cxx::wcstoull; +} +#endif + #endif //_GLIBCPP_USE_WCHAR_T #endif diff --git a/libstdc++-v3/include/c_std/bits/std_cwctype.h b/libstdc++-v3/include/c_std/bits/std_cwctype.h index 9544a824fe9..39ae0767663 100644 --- a/libstdc++-v3/include/c_std/bits/std_cwctype.h +++ b/libstdc++-v3/include/c_std/bits/std_cwctype.h @@ -31,13 +31,9 @@ // ISO C++ 14882: <cwctype> // -// Note: This is not a conforming implementation. - #ifndef _CPP_CWCTYPE #define _CPP_CWCTYPE 1 -#include <bits/std_cwchar.h> - #pragma GCC system_header #include <wctype.h> @@ -60,37 +56,34 @@ #undef towupper #undef towctrans #undef wctrans +#undef wctype namespace std { + using ::wint_t; // cwchar + using ::wctype_t; using ::wctrans_t; - extern "C" int iswalnum(wint_t); - extern "C" int iswalpha(wint_t); - extern "C" int iswblank(wint_t); - extern "C" int iswcntrl(wint_t); - extern "C" int iswdigit(wint_t); - extern "C" int iswgraph(wint_t); - extern "C" int iswlower(wint_t); - extern "C" int iswprint(wint_t); - extern "C" int iswpunct(wint_t); - extern "C" int iswspace(wint_t); - extern "C" int iswupper(wint_t); - extern "C" int iswxdigit(wint_t); - extern "C" int iswctype(wint_t, wctype_t); - extern "C" wctype_t wctype(const char *); - extern "C" wint_t towlower(wint_t); - extern "C" wint_t towupper(wint_t); - extern "C" wint_t towctrans(wint_t, wctrans_t); - extern "C" wctrans_t wctrans(const char*); + using ::iswalnum; + using ::iswalpha; + using ::iswblank; + using ::iswcntrl; + using ::iswdigit; + using ::iswgraph; + using ::iswlower; + using ::iswprint; + using ::iswprint; + using ::iswpunct; + using ::iswspace; + using ::iswupper; + using ::iswxdigit; + using ::iswctype; + using ::towlower; + using ::towupper; + using ::towctrans; + using ::wctrans; + using ::wctype; } #endif - - - - - - - |