diff options
| author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-21 20:21:03 +0000 |
|---|---|---|
| committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-21 20:21:03 +0000 |
| commit | 75fbf2f74062ce6e93a29f34afb36982a5a8eeff (patch) | |
| tree | 5a37abad29c7d3b57928cf12073d1fc3f1aefe6f /libstdc++-v3/include/c | |
| parent | b14b6cce5ffb340519c8125c07293b9b08b7c845 (diff) | |
| download | ppe42-gcc-75fbf2f74062ce6e93a29f34afb36982a5a8eeff.tar.gz ppe42-gcc-75fbf2f74062ce6e93a29f34afb36982a5a8eeff.zip | |
2002-06-21 Benjamin Kosnik <bkoz@redhat.com>
* include/c_compatibility: New.
* include/c_compatibility/assert.h: New.
* include/c_compatibility/ctype.h: New.
* include/c_compatibility/errno.h: New.
* include/c_compatibility/float.h: New.
* include/c_compatibility/iso646.h: New.
* include/c_compatibility/limits.h: New.
* include/c_compatibility/locale.h: New.
* include/c_compatibility/math.h: New.
* include/c_compatibility/setjmp.h: New.
* include/c_compatibility/signal.h: New.
* include/c_compatibility/stdarg.h: New.
* include/c_compatibility/stddef.h: New.
* include/c_compatibility/stdio.h: New.
* include/c_compatibility/stdlib.h: New.
* include/c_compatibility/string.h: New.
* include/c_compatibility/time.h: New.
* include/c_compatibility/wchar.h: New.
* include/c_compatibility/wctype.h: New.
* include/c/std_cerrno.h: Get out of the way... define errno.
* include/c/std_cmath.h: Add abs, modf overloads.
Undefine C99 isms. Still not sure how to deal with this sanely.
* include/c/std_csetjmp.h: Tweak.
* include/c/std_cwchar.h: Include cstddef for size_t.
* include/c_std/std_cmath.h: Remove extra function.
Pendantic std usage in testsuites.
* testsuite/17_intro/header_cstdlib.cc (test01): Qualify ldiv_t
with std.
* testsuite/17_intro/header_cwchar.cc: Tweak.
* testsuite/22_locale/codecvt_members_char_char.cc (test03): Use
std::setlocale.
* testsuite/22_locale/ctype_to_wchar_t.cc (test05): Same.
* testsuite/22_locale/ctype_to_char.cc (test05): Same.
* testsuite/22_locale/ctype_is_wchar_t.cc (test05): Same.
* testsuite/22_locale/ctype_is_char.cc (test05): Same.
* testsuite/22_locale/codecvt_members_wchar_t_char.cc (test03): Same.
* testsuite/22_locale/time_get_members_wchar_t.cc (test08): Same.
* testsuite/22_locale/time_get_members_char.cc (test08): Same.
* testsuite/22_locale/time_put_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/time_put_members_char.cc (test04): Same.
* testsuite/22_locale/num_put_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/num_put_members_char.cc (test04): Same.
* testsuite/22_locale/numpunct_members_wchar_t.cc (test03): Same.
* testsuite/22_locale/numpunct_members_char.cc (test03): Same.
* testsuite/22_locale/num_get_members_wchar_t.cc: Same.
* testsuite/22_locale/num_get_members_char.cc: Same.
* testsuite/22_locale/money_put_members_wchar_t.cc (test07): Same.
* testsuite/22_locale/money_put_members_char.cc (test07): Same.
* testsuite/22_locale/moneypunct_members_wchar_t.cc (test03): Same.
* testsuite/22_locale/moneypunct_members_char.cc (test03): Same.
* testsuite/22_locale/money_get_members_wchar_t.cc (test08): Same.
* testsuite/22_locale/money_get_members_char.cc (test08): Same.
* testsuite/22_locale/messages_members_char.cc (test03): Same.
* testsuite/22_locale/collate_members_wchar_t.cc (test04): Same.
* testsuite/22_locale/collate_members_char.cc (test04): Same.
* testsuite/26_numerics/fabs_inline.cc: Use std::printf.
* testsuite/27_io/istream_seeks.cc (test02): Qualify abort.
* testsuite/27_io/istream_extractor_arith.cc (test11): Qualify strtol.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54891 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/c')
| -rw-r--r-- | libstdc++-v3/include/c/std_cerrno.h | 14 | ||||
| -rw-r--r-- | libstdc++-v3/include/c/std_cmath.h | 83 | ||||
| -rw-r--r-- | libstdc++-v3/include/c/std_csetjmp.h | 8 | ||||
| -rw-r--r-- | libstdc++-v3/include/c/std_cstdio.h | 43 | ||||
| -rw-r--r-- | libstdc++-v3/include/c/std_cwchar.h | 2 |
5 files changed, 150 insertions, 0 deletions
diff --git a/libstdc++-v3/include/c/std_cerrno.h b/libstdc++-v3/include/c/std_cerrno.h index 93ba8684389..646d6096574 100644 --- a/libstdc++-v3/include/c/std_cerrno.h +++ b/libstdc++-v3/include/c/std_cerrno.h @@ -31,6 +31,15 @@ // 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. + */ + #ifndef _CPP_CERRNO #define _CPP_CERRNO 1 @@ -38,4 +47,9 @@ #include_next <errno.h> +// 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_cmath.h b/libstdc++-v3/include/c/std_cmath.h index 33ac50b9f9a..beb7141625c 100644 --- a/libstdc++-v3/include/c/std_cmath.h +++ b/libstdc++-v3/include/c/std_cmath.h @@ -36,6 +36,89 @@ #pragma GCC system_header +#include <bits/c++config.h> + #include_next <math.h> +// Get rid of those macros defined in <math.h> in lieu of real functions. +#undef abs +#undef div +#undef acos +#undef asin +#undef atan +#undef atan2 +#undef ceil +#undef cos +#undef cosh +#undef exp +#undef fabs +#undef floor +#undef fmod +#undef frexp +#undef ldexp +#undef log +#undef log10 +#undef modf +#undef pow +#undef sin +#undef sinh +#undef sqrt +#undef tan +#undef tanh + +#undef fpclassify +#undef isfinite +#undef isinf +#undef isnan +#undef isnormal +#undef signbit +#undef isgreater +#undef isgreaterequal +#undef isless +#undef islessequal +#undef islessgreater +#undef isunordered + +namespace std +{ + inline double + abs(double __x) + { return __builtin_fabs(__x); } + + inline float + abs(float __x) + { return __builtin_fabsf(__x); } + + inline long double + abs(long double __x) + { return __builtin_fabsl(__x); } + +#if _GLIBCPP_HAVE_MODFF + inline float + modf(float __x, float* __iptr) { return modff(__x, __iptr); } +#else + inline float + modf(float __x, float* __iptr) + { + double __tmp; + double __res = modf(static_cast<double>(__x), &__tmp); + *__iptr = static_cast<float>(__tmp); + return __res; + } +#endif + +#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 +} #endif diff --git a/libstdc++-v3/include/c/std_csetjmp.h b/libstdc++-v3/include/c/std_csetjmp.h index 011907bbaa1..fe3f9c70bcd 100644 --- a/libstdc++-v3/include/c/std_csetjmp.h +++ b/libstdc++-v3/include/c/std_csetjmp.h @@ -38,4 +38,12 @@ #include_next <setjmp.h> +// 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) std::setjmp (env) +#endif + #endif diff --git a/libstdc++-v3/include/c/std_cstdio.h b/libstdc++-v3/include/c/std_cstdio.h index 542b92414ca..3d6272aa62e 100644 --- a/libstdc++-v3/include/c/std_cstdio.h +++ b/libstdc++-v3/include/c/std_cstdio.h @@ -38,4 +38,47 @@ #include_next <stdio.h> +// Get rid of those macros defined in <stdio.h> in lieu of real functions. +#undef clearerr +#undef fclose +#undef feof +#undef ferror +#undef fflush +#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 remove +#undef rename +#undef rewind +#undef scanf +#undef setbuf +#undef setvbuf +#undef sprintf +#undef sscanf +#undef tmpfile +#undef tmpnam +#undef ungetc +#undef vfprintf +#undef vprintf +#undef vsprintf + #endif diff --git a/libstdc++-v3/include/c/std_cwchar.h b/libstdc++-v3/include/c/std_cwchar.h index 19739853736..bad9923fa1e 100644 --- a/libstdc++-v3/include/c/std_cwchar.h +++ b/libstdc++-v3/include/c/std_cwchar.h @@ -37,6 +37,8 @@ #pragma GCC system_header #include <bits/c++config.h> +#include <cstddef> +#include <ctime> #if _GLIBCPP_HAVE_WCHAR_H #include_next <wchar.h> |

