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>
* 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.
2000-05-09 Benjamin Kosnik <bkoz@gnu.org>
* acinclude.m4 (GLIBCPP_CHECK_CPU): Change powerpc bits to
......
// 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'.
#undef _GLIBCPP_USE_LONG_LONG
......
......@@ -664,7 +664,7 @@ dnl Run through flags (either default or command-line) and set things.
if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) AC_DEFINE(_GLIBCPP_USE_NAMESPACES) ;;
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
......@@ -680,7 +680,7 @@ dnl
dnl Check for certain special build configurations.
dnl
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 undefined by default in whatever.h.in).
dnl + Eventually, this will go away.
......@@ -702,7 +702,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "$enable_namespaces" in
yes) NAMESPACES='-fhonor-std'
AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
;;
no) NAMESPACES='-fno-honor-std'
;;
......
......@@ -676,7 +676,7 @@ dnl Run through flags (either default or command-line) and set things.
if test -n "$enable_cxx_flags"; then
for f in $enable_cxx_flags; do
case "$f" in
-fhonor-std) AC_DEFINE(_GLIBCPP_USE_NAMESPACES) ;;
-fhonor-std) ;;
-*) ;;
*) # and we're trying to pass /what/ exactly?
AC_MSG_ERROR([compiler flags start with a -]) ;;
......@@ -692,7 +692,7 @@ dnl
dnl Check for certain special build configurations.
dnl
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 undefined by default in whatever.h.in).
dnl + Eventually, this will go away.
......@@ -714,7 +714,6 @@ enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
dnl Option parsed, now set things appropriately
case "$enable_namespaces" in
yes) NAMESPACES='-fhonor-std'
AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
;;
no) NAMESPACES='-fno-honor-std'
;;
......
// -*- 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
// software; you can redistribute it and/or modify it under the
......@@ -56,7 +56,7 @@ namespace std
# undef toupper
inline int
toupper(int __c) { return _S_toupper_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
toupper(int __c) { return ::toupper(__c); }
#endif
......@@ -67,7 +67,7 @@ namespace std
# undef tolower
inline int
tolower(int __c) { return _S_tolower_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
tolower(int __c) { return ::tolower(__c); }
#endif
......@@ -78,7 +78,7 @@ namespace std
# undef isspace
inline int
isspace(int __c) { return _S_isspace_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isspace(int __c) { return ::isspace(__c); }
#endif
......@@ -89,7 +89,7 @@ namespace std
# undef isprint
inline int
isprint(int __c) { return _S_isprint_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isprint(int __c) { return ::isprint(__c); }
#endif
......@@ -100,7 +100,7 @@ namespace std
# undef iscntrl
inline int
iscntrl(int __c) { return _S_iscntrl_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
iscntrl(int __c) { return ::iscntrl(__c); }
#endif
......@@ -111,7 +111,7 @@ namespace std
# undef isupper
inline int
isupper(int __c) { return _S_isupper_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isupper(int __c) { return ::isupper(__c); }
#endif
......@@ -122,7 +122,7 @@ namespace std
# undef islower
inline int
islower(int __c) { return _S_islower_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
islower(int __c) { return ::islower(__c); }
#endif
......@@ -133,7 +133,7 @@ namespace std
# undef isalpha
inline int
isalpha(int __c) { return _S_isalpha_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isalpha(int __c) { return ::isalpha(__c); }
#endif
......@@ -144,7 +144,7 @@ namespace std
# undef isdigit
inline int
isdigit(int __c) { return _S_isdigit_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isdigit(int __c) { return ::isdigit(__c); }
#endif
......@@ -155,7 +155,7 @@ namespace std
# undef ispunct
inline int
ispunct(int __c) { return _S_ispunct_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
ispunct(int __c) { return ::ispunct(__c); }
#endif
......@@ -166,7 +166,7 @@ namespace std
# undef isxdigit
inline int
isxdigit(int __c) { return _S_isxdigit_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isxdigit(int __c) { return ::isxdigit(__c); }
#endif
......@@ -177,7 +177,7 @@ namespace std
# undef isalnum
inline int
isalnum(int __c) { return _S_isalnum_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isalnum(int __c) { return ::isalnum(__c); }
#endif
......@@ -188,7 +188,7 @@ namespace std
# undef isgraph
inline int
isgraph(int __c) { return _S_isgraph_helper(__c); }
#elif _GLIBCPP_USE_NAMESPACES
#else
inline int
isgraph(int __c) { return ::isgraph(__c); }
#endif
......
......@@ -3,13 +3,6 @@
/* Define if you have a working `mmap' system call. */
#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'.
#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
software; you can redistribute it and/or modify it under the
......@@ -82,7 +82,5 @@ double cabs (__complex__ double x);
float cabsf (__complex__ float x);
long double cabsl (__complex__ long double x);
double nan (void);
#endif
/* 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
software; you can redistribute it and/or modify it under the
......@@ -74,6 +74,11 @@ typedef int Int32_t __attribute ((mode (SI)));
# include <nan.h>
#endif
#ifndef NAN
# define NAN (nan())
double nan (void);
#endif
#ifdef _GLIBCPP_HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
......@@ -117,10 +122,6 @@ typedef int Int32_t __attribute ((mode (SI)));
# endif
#endif
#ifndef NAN
# define NAN (nan())
#endif
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
......@@ -327,15 +328,10 @@ do { \
/* Replacement for non-existing float functions. */
#ifndef _GLIBCPP_HAVE_FABSF
# ifdef __GNUC__
/* gcc has fabsf as a builtin command. */
extern float fabsf (float);
# else
#if !defined(_GLIBCPP_HAVE_FABSF) && !defined(_GLIBCPP_HAS_BUILTIN_FABSF)
# define fabsf(x) fabs (x)
# endif
#endif
#ifndef _GLIBCPP_HAVE_COSF
#if !defined(_GLIBCPP_HAVE_COSF) && !defined(_GLIBCPP_HAS_BUILTIN_COSF)
# define cosf(x) cos (x)
#endif
#ifndef _GLIBCPP_HAVE_COSHF
......@@ -353,13 +349,13 @@ extern float fabsf (float);
#ifndef _GLIBCPP_HAVE_POWF
# define powf(x, y) pow (x, y)
#endif
#ifndef _GLIBCPP_HAVE_SINF
#if !defined(_GLIBCPP_HAVE_SINF) && !defined(_GLIBCPP_HAS_BUILTIN_SINF)
# define sinf(x) sin (x)
#endif
#ifndef _GLIBCPP_HAVE_SINHF
# define sinhf(x) sinh (x)
#endif
#ifndef _GLIBCPP_HAVE_SQRTF
#if !defined(_GLIBCPP_HAVE_SQRTF) && !defined(_GLIBCPP_HAS_BUILTIN_SQRTF)
# define sqrtf(x) sqrt (x)
#endif
#ifndef _GLIBCPP_HAVE_TANF
......@@ -375,7 +371,3 @@ extern float fabsf (float);
#ifdef __cplusplus
}
#endif
// 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
// software; you can redistribute it and/or modify it under the
......@@ -30,20 +30,16 @@
// 27.6.1.1 basic_istream
// 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 <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 {
#if 0
// XXX Should work, but doesn't.
using namespace std;
typedef short type_t;
template class basic_istream<type_t, char_traits<type_t> >;
#if 0
template
const ctype<type_t>&
use_facet<ctype<type_t> >(const locale&);
......@@ -55,7 +51,6 @@ namespace test {
#endif
} // test
#endif
int main() {
return 0;
......
// 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
// software; you can redistribute it and/or modify it under the
......@@ -30,21 +30,18 @@
// 27.6.2.1 basic_ostream
// 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 <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 {
#if 0
// XXX Should work, but doesn't.
using namespace std;
typedef short type_t;
template class basic_ostream<type_t, char_traits<type_t> >;
#endif
} // test
#endif
int main() {
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