From 4bff4fb7a87d416e2c430f1e154cccecef872f02 Mon Sep 17 00:00:00 2001 From: bkoz Date: Thu, 26 Apr 2001 02:23:52 +0000 Subject: [PATCH] 2001-04-25 Benjamin Kosnik * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41568 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 12 +++++++++ libstdc++-v3/acconfig.h | 10 -------- libstdc++-v3/config.h.in | 10 -------- libstdc++-v3/include/bits/codecvt.h | 6 ++--- libstdc++-v3/include/c_std/bits/std_cmath.h | 19 +++++++++++++- libstdc++-v3/include/c_std/bits/std_cstdlib.h | 15 +++++++++++ libstdc++-v3/include/c_std/bits/std_cwchar.h | 7 ++++++ .../26_numerics/c99_classification_macros_c++.cc | 29 +++++++++++----------- libstdc++-v3/testsuite/README | 2 +- 9 files changed, 70 insertions(+), 40 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 02934ff..342c0be 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2001-04-25 Benjamin Kosnik + + * 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 * include/ext/slist: Include required header files. diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h index 3c79c8c..d1c674a 100644 --- a/libstdc++-v3/acconfig.h +++ b/libstdc++-v3/acconfig.h @@ -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 diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 51d0e74..4aef400 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -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 diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 7f5df96..badc7fb 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -442,7 +442,7 @@ } else { - if (__flen < __from_end - __from) + if (__flen < static_cast(__from_end - __from)) { __from_next = reinterpret_cast(__cfrom); __to_next = reinterpret_cast(__cto); @@ -548,7 +548,7 @@ } else { - if (__flen < __from_end - __from) + if (__flen < static_cast(__from_end - __from)) { __from_next = reinterpret_cast(__cfrom); __to_next = reinterpret_cast(__cto); @@ -576,7 +576,7 @@ template 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(__end - __from)); } diff --git a/libstdc++-v3/include/c_std/bits/std_cmath.h b/libstdc++-v3/include/c_std/bits/std_cmath.h index 9ec8284..d37f900 100644 --- a/libstdc++-v3/include/c_std/bits/std_cmath.h +++ b/libstdc++-v3/include/c_std/bits/std_cmath.h @@ -722,13 +722,30 @@ namespace c99 template int - islessgreater(_Tp __f) { return __capture_islessgreater(__f); } + islessgreater(_Tp __f1, _Tp __f2) + { return __capture_islessgreater(__f1, __f2); } template 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 diff --git a/libstdc++-v3/include/c_std/bits/std_cstdlib.h b/libstdc++-v3/include/c_std/bits/std_cstdlib.h index b8365e0..50ef583 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdlib.h +++ b/libstdc++-v3/include/c_std/bits/std_cstdlib.h @@ -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 diff --git a/libstdc++-v3/include/c_std/bits/std_cwchar.h b/libstdc++-v3/include/c_std/bits/std_cwchar.h index 4bf8c83..0919ab0 100644 --- a/libstdc++-v3/include/c_std/bits/std_cwchar.h +++ b/libstdc++-v3/include/c_std/bits/std_cwchar.h @@ -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 diff --git a/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc index 4fa586e..132cebf 100644 --- a/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc +++ b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc @@ -59,26 +59,25 @@ void isunordered() { } template 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(); - test_c99_classify(); + //test_c99_classify(); #endif return 0; } diff --git a/libstdc++-v3/testsuite/README b/libstdc++-v3/testsuite/README index c48f4db..61c6bd2 100644 --- a/libstdc++-v3/testsuite/README +++ b/libstdc++-v3/testsuite/README @@ -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. -- 2.7.4