std_cmath.h (std): Explicitly inject c99 names.

2001-04-25  Benjamin Kosnik  <bkoz@redhat.com>

	* include/c_std/bits/std_cmath.h (std): Explicitly inject c99 names.
	* include/c_std/bits/std_cstdlib.h (std): Same, except for llabs.
	* include/c_std/bits/std_cwchar.h (std): Same.
	* acconfig.h (std): Remove c99 injection into std.
	* config.h.in: Regenerate.

	* testsuite/README: Fix typo.

	* include/bits/codecvt.h: Remove warnings.

From-SVN: r41568
This commit is contained in:
Benjamin Kosnik 2001-04-26 02:23:52 +00:00 committed by Benjamin Kosnik
parent 0cd99be737
commit 5db6f3de56
9 changed files with 70 additions and 40 deletions

View file

@ -1,3 +1,15 @@
2001-04-25 Benjamin Kosnik <bkoz@redhat.com>
* include/c_std/bits/std_cmath.h (std): Explicitly inject c99 names.
* include/c_std/bits/std_cstdlib.h (std): Same, except for llabs.
* include/c_std/bits/std_cwchar.h (std): Same.
* acconfig.h (std): Remove c99 injection into std.
* config.h.in: Regenerate.
* testsuite/README: Fix typo.
* include/bits/codecvt.h: Remove warnings.
2001-04-24 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
* include/ext/slist: Include required header files.

View file

@ -98,16 +98,6 @@
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
//
#if defined(_GLIBCPP_USE_C99) && defined(__cplusplus)
// Placeholder for declarations in c99 namespace.
namespace std
{
namespace c99 { }
using namespace c99;
}
#endif
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
# define HAVE_ISNAN 1
# define isnan _isnan

View file

@ -559,16 +559,6 @@
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
//
#if defined(_GLIBCPP_USE_C99) && defined(__cplusplus)
// Placeholder for declarations in c99 namespace.
namespace std
{
namespace c99 { }
using namespace c99;
}
#endif
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
# define HAVE_ISNAN 1
# define isnan _isnan

View file

@ -442,7 +442,7 @@
}
else
{
if (__flen < __from_end - __from)
if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
@ -548,7 +548,7 @@
}
else
{
if (__flen < __from_end - __from)
if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
@ -576,7 +576,7 @@
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
do_length(const state_type& __state, const extern_type* __from,
do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return min(__max, static_cast<size_t>(__end - __from)); }

View file

@ -722,13 +722,30 @@ namespace c99
template<typename _Tp>
int
islessgreater(_Tp __f) { return __capture_islessgreater(__f); }
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 c99::fpclassify;
using c99::isfinite;
using c99::isinf;
using c99::isnan;
using c99::isnormal;
using c99::signbit;
using c99::isgreater;
using c99::isgreaterequal;
using c99::isless;
using c99::islessequal;
using c99::islessgreater;
using c99::isunordered;
}
#endif
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT

View file

@ -152,6 +152,21 @@ namespace c99
extern "C" long double strtold(const char*, char**);
#endif
} // namespace c99
namespace std
{
using c99::lldiv_t;
using c99::abs;
//using c99::llabs; // XXX ???
using c99::div;
using c99::lldiv;
using c99::atoll;
using c99::strtoll;
using c99::strtoull;
#ifdef _GLIBCPP_HAVE_STRTOLD
using c99::strtold;
#endif
}
#endif
#endif

View file

@ -204,6 +204,13 @@ namespace c99
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);
}
namespace std
{
using c99::wcstold;
using c99::wcstoll;
using c99::wcstoull;
}
#endif
#endif //_GLIBCPP_USE_WCHAR_T

View file

@ -59,26 +59,25 @@ void isunordered() { }
template <typename _Tp>
void test_c99_classify()
{
using namespace std;
test = bool;
bool test = true;
typedef _Tp fp_type;
fp_type f1 = 1.0;
fp_type f2 = 3.0;
int res = 0;
res = fpclassify(f1);
res = isfinite(f2);
res = isinf(f1);
res = isnan(f2);
res = isnormal(f1);
res = signbit(f2);
res = isgreater(f1, f2);
res = isgreaterequal(f1, f2);
res = isless(f1, f2);
res = islessequal(f1,f2);
res = islessgreater(f1, f2);
res = isunordered(f1, f2);
res = std::fpclassify(f1);
res = std::isfinite(f2);
res = std::isinf(f1);
res = std::isnan(f2);
res = std::isnormal(f1);
res = std::signbit(f2);
res = std::isgreater(f1, f2);
res = std::isgreaterequal(f1, f2);
res = std::isless(f1, f2);
res = std::islessequal(f1,f2);
res = std::islessgreater(f1, f2);
res = std::isunordered(f1, f2);
}
#endif
@ -86,7 +85,7 @@ int main()
{
#if _GLIBCPP_USE_C99
test_c99_classify<float>();
test_c99_classify<double>();
//test_c99_classify<double>();
#endif
return 0;
}

View file

@ -8,7 +8,7 @@ testcases should be written with the new style DejaGnu framework in
mind.
To ease transition, here is the list of dg-keyword documentation
lifted from dg.exp -- eventuaklly we should improve DejaGnu
lifted from dg.exp -- eventually we should improve DejaGnu
documentation, but getting checkin account currently demands Pyrrhic
effort.