Commit 991a40fc by Benjamin Kosnik Committed by Benjamin Kosnik

std_cmath.h: Tweaks.


2000-05-10  Benjamin Kosnik  <bkoz@redhat.com>

	* bits/std_cmath.h: Tweaks.
	* math/mathconf.h: Tweaks and fixes for HP-UX 11.
	(sqrtf): Define away iff !builtin and !in <math.h>.
	(sinf): Same.
	(cosf): Same.
	(fabsf): Same.
	At some point this directory should be converted to c++, the
	autoconf tests should be run by the c++ compiler (not c), and
	<cmath> should be used instead of math.h.
	Move declaration of nan() here.
	* math/complex-stub.h (cabsl): Remove nan() declaration.

	Finish up FreeBSD4.0 support.
	* config/bsd/ctype.cc: Scope out toupper, tolower calls.
	* config/generic/ctype.cc: And here.
	* testsuite/21_strings/char_traits.cc (test02): Guard with
	_GLIBCPP_USE_WCHAR_T.

	via Phil Edwards  <pme@sourceware.cygnus.com>
	* bits/std_cctype.h: Remove _GLIBCPP_USE_NAMESPACES.
	* acconfig.h: And here.
	* acinclude.m4: Same.
	* testsuite/27_io/istream.cc: And here.
	* testsuite/27_io/ostream.cc: And here.

From-SVN: r33835
parent 8e9bf55e
2000-05-10 Benjamin Kosnik <bkoz@redhat.com> 2000-05-10 Benjamin Kosnik <bkoz@redhat.com>
* bits/std_cmath.h: Tweaks.
* math/mathconf.h: Tweaks and fixes for HP-UX 11.
(sqrtf): Define away iff !builtin and !in <math.h>.
(sinf): Same.
(cosf): Same.
(fabsf): Same.
At some point this directory should be converted to c++, the
autoconf tests should be run by the c++ compiler (not c), and
<cmath> should be used instead of math.h.
Move declaration of nan() here.
* math/complex-stub.h (cabsl): Remove nan() declaration.
Finish up FreeBSD4.0 support. Finish up FreeBSD4.0 support.
* config/bsd/ctype.cc: Scope out toupper, tolower calls. * config/bsd/ctype.cc: Scope out toupper, tolower calls.
* config/generic/ctype.cc: And here. * config/generic/ctype.cc: And here.
* testsuite/21_strings/char_traits.cc (test02): Guard with * testsuite/21_strings/char_traits.cc (test02): Guard with
_GLIBCPP_USE_WCHAR_T. _GLIBCPP_USE_WCHAR_T.
via Phil Edwards <pme@sourceware.cygnus.com>
* bits/std_cctype.h: Remove _GLIBCPP_USE_NAMESPACES.
* acconfig.h: And here.
* acinclude.m4: Same.
* testsuite/27_io/istream.cc: And here.
* testsuite/27_io/ostream.cc: And here.
2000-05-09 Benjamin Kosnik <bkoz@gnu.org> 2000-05-09 Benjamin Kosnik <bkoz@gnu.org>
* acinclude.m4 (GLIBCPP_CHECK_CPU): Change powerpc bits to * acinclude.m4 (GLIBCPP_CHECK_CPU): Change powerpc bits to
......
// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*- // acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
// If using the namespace std, you need this. Eventually this should
// not be an option. In the meantime, and as things like std_ctype.h
// need to be hacked out, give people the option. If this is set to 1,
// CXXFLAGS should include -fhonor-std. If this is undefined, CXXFLAGS
// should include -fno-honor-std.
#undef _GLIBCPP_USE_NAMESPACES
// Include support for 'long long' and 'unsigned long long'. // Include support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG #undef _GLIBCPP_USE_LONG_LONG
......
...@@ -664,7 +664,7 @@ dnl Run through flags (either default or command-line) and set things. ...@@ -664,7 +664,7 @@ dnl Run through flags (either default or command-line) and set things.
if test -n "$enable_cxx_flags"; then if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do for f in $enable_cxx_flags; do
case "$f" in case "$f" in
-fhonor-std) AC_DEFINE(_GLIBCPP_USE_NAMESPACES) ;; -fhonor-std) ;;
-*) ;; -*) ;;
*) # and we're trying to pass /what/ exactly? *) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;; AC_MSG_ERROR([compiler flags start with a -]) ;;
...@@ -680,7 +680,7 @@ dnl ...@@ -680,7 +680,7 @@ dnl
dnl Check for certain special build configurations. dnl Check for certain special build configurations.
dnl dnl
dnl GLIBCPP_ENABLE_NAMESPACES dnl GLIBCPP_ENABLE_NAMESPACES
dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES dnl --enable-namespaces sets '-fhonor-std' and
dnl --disable-namespaces sets '-fno-honor-std' (the macro should be dnl --disable-namespaces sets '-fno-honor-std' (the macro should be
dnl undefined by default in whatever.h.in). dnl undefined by default in whatever.h.in).
dnl + Eventually, this will go away. dnl + Eventually, this will go away.
...@@ -702,7 +702,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl ...@@ -702,7 +702,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_namespaces" in case "$enable_namespaces" in
yes) NAMESPACES='-fhonor-std' yes) NAMESPACES='-fhonor-std'
AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
;; ;;
no) NAMESPACES='-fno-honor-std' no) NAMESPACES='-fno-honor-std'
;; ;;
......
...@@ -676,7 +676,7 @@ dnl Run through flags (either default or command-line) and set things. ...@@ -676,7 +676,7 @@ dnl Run through flags (either default or command-line) and set things.
if test -n "$enable_cxx_flags"; then if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do for f in $enable_cxx_flags; do
case "$f" in case "$f" in
-fhonor-std) AC_DEFINE(_GLIBCPP_USE_NAMESPACES) ;; -fhonor-std) ;;
-*) ;; -*) ;;
*) # and we're trying to pass /what/ exactly? *) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;; AC_MSG_ERROR([compiler flags start with a -]) ;;
...@@ -692,7 +692,7 @@ dnl ...@@ -692,7 +692,7 @@ dnl
dnl Check for certain special build configurations. dnl Check for certain special build configurations.
dnl dnl
dnl GLIBCPP_ENABLE_NAMESPACES dnl GLIBCPP_ENABLE_NAMESPACES
dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES dnl --enable-namespaces sets '-fhonor-std' and
dnl --disable-namespaces sets '-fno-honor-std' (the macro should be dnl --disable-namespaces sets '-fno-honor-std' (the macro should be
dnl undefined by default in whatever.h.in). dnl undefined by default in whatever.h.in).
dnl + Eventually, this will go away. dnl + Eventually, this will go away.
...@@ -714,7 +714,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl ...@@ -714,7 +714,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "$enable_namespaces" in case "$enable_namespaces" in
yes) NAMESPACES='-fhonor-std' yes) NAMESPACES='-fhonor-std'
AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
;; ;;
no) NAMESPACES='-fno-honor-std' no) NAMESPACES='-fno-honor-std'
;; ;;
......
// -*- C++ -*- forwarding header. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -56,7 +56,7 @@ namespace std ...@@ -56,7 +56,7 @@ namespace std
# undef toupper # undef toupper
inline int inline int
toupper(int __c) { return _S_toupper_helper(__c); } toupper(int __c) { return _S_toupper_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
toupper(int __c) { return ::toupper(__c); } toupper(int __c) { return ::toupper(__c); }
#endif #endif
...@@ -67,7 +67,7 @@ namespace std ...@@ -67,7 +67,7 @@ namespace std
# undef tolower # undef tolower
inline int inline int
tolower(int __c) { return _S_tolower_helper(__c); } tolower(int __c) { return _S_tolower_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
tolower(int __c) { return ::tolower(__c); } tolower(int __c) { return ::tolower(__c); }
#endif #endif
...@@ -78,7 +78,7 @@ namespace std ...@@ -78,7 +78,7 @@ namespace std
# undef isspace # undef isspace
inline int inline int
isspace(int __c) { return _S_isspace_helper(__c); } isspace(int __c) { return _S_isspace_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isspace(int __c) { return ::isspace(__c); } isspace(int __c) { return ::isspace(__c); }
#endif #endif
...@@ -89,7 +89,7 @@ namespace std ...@@ -89,7 +89,7 @@ namespace std
# undef isprint # undef isprint
inline int inline int
isprint(int __c) { return _S_isprint_helper(__c); } isprint(int __c) { return _S_isprint_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isprint(int __c) { return ::isprint(__c); } isprint(int __c) { return ::isprint(__c); }
#endif #endif
...@@ -100,7 +100,7 @@ namespace std ...@@ -100,7 +100,7 @@ namespace std
# undef iscntrl # undef iscntrl
inline int inline int
iscntrl(int __c) { return _S_iscntrl_helper(__c); } iscntrl(int __c) { return _S_iscntrl_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
iscntrl(int __c) { return ::iscntrl(__c); } iscntrl(int __c) { return ::iscntrl(__c); }
#endif #endif
...@@ -111,7 +111,7 @@ namespace std ...@@ -111,7 +111,7 @@ namespace std
# undef isupper # undef isupper
inline int inline int
isupper(int __c) { return _S_isupper_helper(__c); } isupper(int __c) { return _S_isupper_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isupper(int __c) { return ::isupper(__c); } isupper(int __c) { return ::isupper(__c); }
#endif #endif
...@@ -122,7 +122,7 @@ namespace std ...@@ -122,7 +122,7 @@ namespace std
# undef islower # undef islower
inline int inline int
islower(int __c) { return _S_islower_helper(__c); } islower(int __c) { return _S_islower_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
islower(int __c) { return ::islower(__c); } islower(int __c) { return ::islower(__c); }
#endif #endif
...@@ -133,7 +133,7 @@ namespace std ...@@ -133,7 +133,7 @@ namespace std
# undef isalpha # undef isalpha
inline int inline int
isalpha(int __c) { return _S_isalpha_helper(__c); } isalpha(int __c) { return _S_isalpha_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isalpha(int __c) { return ::isalpha(__c); } isalpha(int __c) { return ::isalpha(__c); }
#endif #endif
...@@ -144,7 +144,7 @@ namespace std ...@@ -144,7 +144,7 @@ namespace std
# undef isdigit # undef isdigit
inline int inline int
isdigit(int __c) { return _S_isdigit_helper(__c); } isdigit(int __c) { return _S_isdigit_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isdigit(int __c) { return ::isdigit(__c); } isdigit(int __c) { return ::isdigit(__c); }
#endif #endif
...@@ -155,7 +155,7 @@ namespace std ...@@ -155,7 +155,7 @@ namespace std
# undef ispunct # undef ispunct
inline int inline int
ispunct(int __c) { return _S_ispunct_helper(__c); } ispunct(int __c) { return _S_ispunct_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
ispunct(int __c) { return ::ispunct(__c); } ispunct(int __c) { return ::ispunct(__c); }
#endif #endif
...@@ -166,7 +166,7 @@ namespace std ...@@ -166,7 +166,7 @@ namespace std
# undef isxdigit # undef isxdigit
inline int inline int
isxdigit(int __c) { return _S_isxdigit_helper(__c); } isxdigit(int __c) { return _S_isxdigit_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isxdigit(int __c) { return ::isxdigit(__c); } isxdigit(int __c) { return ::isxdigit(__c); }
#endif #endif
...@@ -177,7 +177,7 @@ namespace std ...@@ -177,7 +177,7 @@ namespace std
# undef isalnum # undef isalnum
inline int inline int
isalnum(int __c) { return _S_isalnum_helper(__c); } isalnum(int __c) { return _S_isalnum_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isalnum(int __c) { return ::isalnum(__c); } isalnum(int __c) { return ::isalnum(__c); }
#endif #endif
...@@ -188,7 +188,7 @@ namespace std ...@@ -188,7 +188,7 @@ namespace std
# undef isgraph # undef isgraph
inline int inline int
isgraph(int __c) { return _S_isgraph_helper(__c); } isgraph(int __c) { return _S_isgraph_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES #else
inline int inline int
isgraph(int __c) { return ::isgraph(__c); } isgraph(int __c) { return ::isgraph(__c); }
#endif #endif
......
...@@ -42,203 +42,203 @@ ...@@ -42,203 +42,203 @@
namespace std { namespace std {
inline long inline long
abs(long __l) { return ::labs(__l); } abs(long __l) { return ::labs(__l); }
inline ldiv_t inline ldiv_t
div(long __a, long __b) { return ::ldiv(__a, __b); } div(long __a, long __b) { return ::ldiv(__a, __b); }
// double // double
inline double inline double
abs(double __x) { return ::fabs(__x); } abs(double __x) { return ::fabs(__x); }
double double
pow(double, int); pow(double, int);
// float // float
inline float inline float
ceil(float __x) { return ::ceil(static_cast<double>(__x)); } ceil(float __x) { return ::ceil(static_cast<double>(__x)); }
inline float inline float
floor(float __x) { return ::floor(static_cast<double>(__x)); } floor(float __x) { return ::floor(static_cast<double>(__x)); }
inline float inline float
fmod(float __x, float __y) fmod(float __x, float __y)
{ return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); } { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
inline float inline float
frexp(float __x, int* __p) frexp(float __x, int* __p)
{ return ::frexp(static_cast<double>(__x), __p); } { return ::frexp(static_cast<double>(__x), __p); }
inline float inline float
ldexp(float __x, int __i) ldexp(float __x, int __i)
{ return ::ldexp(static_cast<double>(__x), __i); } { return ::ldexp(static_cast<double>(__x), __i); }
inline float inline float
pow(float __x, float __y) pow(float __x, float __y)
{ return ::pow(static_cast<double>(__x), static_cast<double>(__y)); } { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
float float
pow(float, int); pow(float, int);
#if _GLIBCPP_HAVE_ABSF #if _GLIBCPP_HAVE_ABSF
inline float inline float
abs(float __x) { return ::absf(__x); } abs(float __x) { return ::absf(__x); }
#else #else
inline float inline float
abs(float __x) { return ::fabs(static_cast<double>(__x)); } abs(float __x) { return ::fabs(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_ACOSF #if _GLIBCPP_HAVE_ACOSF
inline float inline float
acos(float __x) { return ::acosf(__x); } acos(float __x) { return ::acosf(__x); }
#else #else
inline float inline float
acos(float __x) { return ::acos(static_cast<double>(__x)); } acos(float __x) { return ::acos(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_ASINF #if _GLIBCPP_HAVE_ASINF
inline float inline float
asin(float __x) { return ::asinf(__x); } asin(float __x) { return ::asinf(__x); }
#else #else
inline float inline float
asin(float __x) { return ::asin(static_cast<double>(__x)); } asin(float __x) { return ::asin(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_ATANF #if _GLIBCPP_HAVE_ATANF
inline float inline float
atan(float __x) { return ::atanf(__x); } atan(float __x) { return ::atanf(__x); }
#else #else
inline float inline float
atan(float __x) { return ::atan(static_cast<double>(__x)); } atan(float __x) { return ::atan(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_ATAN2F #if _GLIBCPP_HAVE_ATAN2F
inline float inline float
atan2(float __x, float __y) { return ::atan2f(__x, __y); } atan2(float __x, float __y) { return ::atan2f(__x, __y); }
#else #else
inline float inline float
atan2(float __x, float __y) atan2(float __x, float __y)
{ return ::atan2(static_cast<double>(__x), static_cast<double>(__y)); } { return ::atan2(static_cast<double>(__x), static_cast<double>(__y)); }
#endif #endif
#if _GLIBCPP_HAVE_TANF #if _GLIBCPP_HAVE_TANF
inline float inline float
tan(float __x) { return ::tanf(__x); } tan(float __x) { return ::tanf(__x); }
#else #else
inline float inline float
tan(float __x) { return ::tan(static_cast<double>(__x)); } tan(float __x) { return ::tan(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_SINHF #if _GLIBCPP_HAVE_SINHF
inline float inline float
sinh(float __x) { return ::sinhf(__x); } sinh(float __x) { return ::sinhf(__x); }
#else #else
inline float inline float
sinh(float __x) { return ::sinh(static_cast<double>(__x)); } sinh(float __x) { return ::sinh(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_TANHF #if _GLIBCPP_HAVE_TANHF
inline float inline float
tanh(float __x) { return ::tanhf(__x); } tanh(float __x) { return ::tanhf(__x); }
#else #else
inline float inline float
tanh(float __x) { return ::tanh(static_cast<double>(__x)); } tanh(float __x) { return ::tanh(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_COSHF #if _GLIBCPP_HAVE_COSHF
inline float inline float
cosh(float __x) { return ::coshf(__x); } cosh(float __x) { return ::coshf(__x); }
#else #else
inline float inline float
cosh(float __x) { return ::cosh(static_cast<double>(__x)); } cosh(float __x) { return ::cosh(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_EXPF #if _GLIBCPP_HAVE_EXPF
inline float inline float
exp(float __x) { return ::expf(__x); } exp(float __x) { return ::expf(__x); }
#else #else
inline float inline float
exp(float __x) { return ::exp(static_cast<double>(__x)); } exp(float __x) { return ::exp(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_LOGF #if _GLIBCPP_HAVE_LOGF
inline float inline float
log(float __x) { return ::logf(__x); } log(float __x) { return ::logf(__x); }
#else #else
inline float inline float
log(float __x) { return ::log(static_cast<double>(__x)); } log(float __x) { return ::log(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_LOG10F #if _GLIBCPP_HAVE_LOG10F
inline float inline float
log10(float __x) { return ::log10f(__x); } log10(float __x) { return ::log10f(__x); }
#else #else
inline float inline float
log10(float __x) { return ::log10(static_cast<double>(__x)); } log10(float __x) { return ::log10(static_cast<double>(__x)); }
#endif #endif
#if _GLIBCPP_HAVE_MODFF #if _GLIBCPP_HAVE_MODFF
inline float inline float
modf(float __x, float* __p) { return ::modff(__x, __p); } modf(float __x, float* __p) { return ::modff(__x, __p); }
#else #else
inline float inline float
modf(float __x, float* __p) modf(float __x, float* __p)
{ {
double __tmp; double __tmp;
double __res = ::modf(static_cast<double>(__x), &__tmp); double __res = ::modf(static_cast<double>(__x), &__tmp);
*__p = static_cast<float> (__tmp); *__p = static_cast<float> (__tmp);
return __res; return __res;
} }
#endif #endif
#if GLIBCPP_HAS_BUILTIN_SINF #if GLIBCPP_HAS_BUILTIN_SINF
inline float inline float
sin(float __x) { return __builtin_sinf(__x); } sin(float __x) { return __builtin_sinf(__x); }
#elif _GLIBCPP_HAVE_SINF #elif _GLIBCPP_HAVE_SINF
inline float inline float
sin(float __x) { return ::sinf(__x); } sin(float __x) { return ::sinf(__x); }
#else #else
inline float inline float
sin(float __x) { return ::sin(static_cast<double>(__x)); } sin(float __x) { return ::sin(static_cast<double>(__x)); }
#endif #endif
#if GLIBCPP_HAS_BUILTIN_COSF #if GLIBCPP_HAS_BUILTIN_COSF
inline float inline float
cos(float __x) { return __builtin_cosf(__x); } cos(float __x) { return __builtin_cosf(__x); }
#elif _GLIBCPP_HAVE_COSF #elif _GLIBCPP_HAVE_COSF
inline float inline float
cos(float __x) { return ::cosf(__x); } cos(float __x) { return ::cosf(__x); }
#else #else
inline float inline float
cos(float __x) { return ::cos(static_cast<double>(__x)); } cos(float __x) { return ::cos(static_cast<double>(__x)); }
#endif #endif
#if GLIBCPP_HAS_BUILTIN_FABSF #if GLIBCPP_HAS_BUILTIN_FABSF
inline float inline float
fabs(float __x) { return __builtin_fabsf(__x); } fabs(float __x) { return __builtin_fabsf(__x); }
#elif _GLIBCPP_HAVE_FABSF #elif _GLIBCPP_HAVE_FABSF
inline float inline float
fabs(float __x) { return ::fabsf(__x); } fabs(float __x) { return ::fabsf(__x); }
#else #else
inline float inline float
fabs(float __x) { return ::fabs(static_cast<double>(__x)); } fabs(float __x) { return ::fabs(static_cast<double>(__x)); }
#endif #endif
#if GLIBCPP_HAS_BUILTIN_SQRTF #if GLIBCPP_HAS_BUILTIN_SQRTF
inline float inline float
sqrt(float __x) { return __builtin_sqrtf(__x); } sqrt(float __x) { return __builtin_sqrtf(__x); }
#elif _GLIBCPP_HAVE_SQRTF #elif _GLIBCPP_HAVE_SQRTF
inline float inline float
sqrt(float __x) { return ::sqrtf(__x); } sqrt(float __x) { return ::sqrtf(__x); }
#else #else
inline float inline float
sqrt(float __x) { return ::fabs(static_cast<double>(__x)); } sqrt(float __x) { return ::fabs(static_cast<double>(__x)); }
#endif #endif
// XXX long double // XXX long double
long double long double
pow(long double, int); pow(long double, int);
} // std } // std
......
...@@ -3,13 +3,6 @@ ...@@ -3,13 +3,6 @@
/* Define if you have a working `mmap' system call. */ /* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP #undef HAVE_MMAP
// If using the namespace std, you need this. Eventually this should
// not be an option. In the meantime, and as things like std_ctype.h
// need to be hacked out, give people the option. If this is set to 1,
// CXXFLAGS should include -fhonor-std. If this is undefined, CXXFLAGS
// should include -fno-honor-std.
#undef _GLIBCPP_USE_NAMESPACES
// Include support for 'long long' and 'unsigned long long'. // Include support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG #undef _GLIBCPP_USE_LONG_LONG
......
/* Copyright (C) 1997-1999 Free Software Foundation, Inc. /* Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free 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 software; you can redistribute it and/or modify it under the
...@@ -82,7 +82,5 @@ double cabs (__complex__ double x); ...@@ -82,7 +82,5 @@ double cabs (__complex__ double x);
float cabsf (__complex__ float x); float cabsf (__complex__ float x);
long double cabsl (__complex__ long double x); long double cabsl (__complex__ long double x);
double nan (void);
#endif #endif
/* Configuration data for libmath subpart of libstdc++. */ /* Configuration data for libmath subpart of libstdc++. */
/* Copyright (C) 1997-1999 Free Software Foundation, Inc. /* Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free 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 software; you can redistribute it and/or modify it under the
...@@ -74,6 +74,11 @@ typedef int Int32_t __attribute ((mode (SI))); ...@@ -74,6 +74,11 @@ typedef int Int32_t __attribute ((mode (SI)));
# include <nan.h> # include <nan.h>
#endif #endif
#ifndef NAN
# define NAN (nan())
double nan (void);
#endif
#ifdef _GLIBCPP_HAVE_IEEEFP_H #ifdef _GLIBCPP_HAVE_IEEEFP_H
# include <ieeefp.h> # include <ieeefp.h>
#endif #endif
...@@ -117,10 +122,6 @@ typedef int Int32_t __attribute ((mode (SI))); ...@@ -117,10 +122,6 @@ typedef int Int32_t __attribute ((mode (SI)));
# endif # endif
#endif #endif
#ifndef NAN
# define NAN (nan())
#endif
#ifndef M_PI #ifndef M_PI
# define M_PI 3.14159265358979323846 # define M_PI 3.14159265358979323846
#endif #endif
...@@ -327,15 +328,10 @@ do { \ ...@@ -327,15 +328,10 @@ do { \
/* Replacement for non-existing float functions. */ /* Replacement for non-existing float functions. */
#ifndef _GLIBCPP_HAVE_FABSF #if !defined(_GLIBCPP_HAVE_FABSF) && !defined(_GLIBCPP_HAS_BUILTIN_FABSF)
# ifdef __GNUC__ # define fabsf(x) fabs (x)
/* gcc has fabsf as a builtin command. */
extern float fabsf (float);
# else
# define fabsf(x) fabs (x)
# endif
#endif #endif
#ifndef _GLIBCPP_HAVE_COSF #if !defined(_GLIBCPP_HAVE_COSF) && !defined(_GLIBCPP_HAS_BUILTIN_COSF)
# define cosf(x) cos (x) # define cosf(x) cos (x)
#endif #endif
#ifndef _GLIBCPP_HAVE_COSHF #ifndef _GLIBCPP_HAVE_COSHF
...@@ -353,13 +349,13 @@ extern float fabsf (float); ...@@ -353,13 +349,13 @@ extern float fabsf (float);
#ifndef _GLIBCPP_HAVE_POWF #ifndef _GLIBCPP_HAVE_POWF
# define powf(x, y) pow (x, y) # define powf(x, y) pow (x, y)
#endif #endif
#ifndef _GLIBCPP_HAVE_SINF #if !defined(_GLIBCPP_HAVE_SINF) && !defined(_GLIBCPP_HAS_BUILTIN_SINF)
# define sinf(x) sin (x) # define sinf(x) sin (x)
#endif #endif
#ifndef _GLIBCPP_HAVE_SINHF #ifndef _GLIBCPP_HAVE_SINHF
# define sinhf(x) sinh (x) # define sinhf(x) sinh (x)
#endif #endif
#ifndef _GLIBCPP_HAVE_SQRTF #if !defined(_GLIBCPP_HAVE_SQRTF) && !defined(_GLIBCPP_HAS_BUILTIN_SQRTF)
# define sqrtf(x) sqrt (x) # define sqrtf(x) sqrt (x)
#endif #endif
#ifndef _GLIBCPP_HAVE_TANF #ifndef _GLIBCPP_HAVE_TANF
...@@ -375,7 +371,3 @@ extern float fabsf (float); ...@@ -375,7 +371,3 @@ extern float fabsf (float);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
// 1999-09-20 bkoz // 1999-09-20 bkoz
// Copyright (C) 1999 Free Software Foundation, Inc. // Copyright (C) 1999, 2000 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -30,20 +30,16 @@ ...@@ -30,20 +30,16 @@
// 27.6.1.1 basic_istream // 27.6.1.1 basic_istream
// NB: This file is for testing istream with NO OTHER INCLUDES. // NB: This file is for testing istream with NO OTHER INCLUDES.
// XXX only if using namespaces, as without leads to duplicate symbols
#if _GLIBCPP_USE_NAMESPACES
#include <istream> #include <istream>
#include <bits/basic_ios.tcc> // XXX Hack, in a perfect world this not needed.
#include <locale> // XXX As above, needed for ctype/num_get use_facets(...)
#include <bits/locale_facets.tcc> // XXX
namespace test { namespace test {
#if 0
// XXX Should work, but doesn't.
using namespace std; using namespace std;
typedef short type_t; typedef short type_t;
template class basic_istream<type_t, char_traits<type_t> >; template class basic_istream<type_t, char_traits<type_t> >;
#if 0
template template
const ctype<type_t>& const ctype<type_t>&
use_facet<ctype<type_t> >(const locale&); use_facet<ctype<type_t> >(const locale&);
...@@ -55,7 +51,6 @@ namespace test { ...@@ -55,7 +51,6 @@ namespace test {
#endif #endif
} // test } // test
#endif
int main() { int main() {
return 0; return 0;
......
// 1999-09-20 bkoz // 1999-09-20 bkoz
// Copyright (C) 1999 Free Software Foundation, Inc. // Copyright (C) 1999, 2000 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -30,21 +30,18 @@ ...@@ -30,21 +30,18 @@
// 27.6.2.1 basic_ostream // 27.6.2.1 basic_ostream
// NB: This file is for testing ostream with NO OTHER INCLUDES. // NB: This file is for testing ostream with NO OTHER INCLUDES.
// XXX only if using namespaces, as without leads to duplicate symbols
#if _GLIBCPP_USE_NAMESPACES
#include <ostream> #include <ostream>
#include <bits/basic_ios.tcc> // XXX Hack, in a perfect world this not needed.
#include <locale> // XXX As above, needed for ctype/num_get use_facets(...)
#include <bits/locale_facets.tcc>
namespace test { namespace test {
#if 0
// XXX Should work, but doesn't.
using namespace std; using namespace std;
typedef short type_t; typedef short type_t;
template class basic_ostream<type_t, char_traits<type_t> >; template class basic_ostream<type_t, char_traits<type_t> >;
#endif
} // test } // test
#endif
int main() { int main() {
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment