Commit 54da4898 by Benjamin Kosnik Committed by Benjamin Kosnik

mknumeric_limits: Add static defintions, format.


2001-06-19  Benjamin Kosnik  <bkoz@redhat.com>

	* mknumeric_limits: Add static defintions, format.
	* testsuite/18_support/numeric_limits.cc (test02): Add test.

	* include/c_std/bits/std_cwchar.h: Include ctime.
	* testsuite/17_intro/header_cwchar.cc : Check.

	* include/c_std/bits/std_cwctype.h: Inject wctype.

From-SVN: r43466
parent 78373ade
2001-06-19 Benjamin Kosnik <bkoz@redhat.com>
* mknumeric_limits: Add static defintions, format.
* testsuite/18_support/numeric_limits.cc (test02): Add test.
* include/c_std/bits/std_cwchar.h: Include ctime.
* testsuite/17_intro/header_cwchar.cc : Check.
* include/c_std/bits/std_cwctype.h: Inject wctype.
* testsuite/17_intro/header_cwctype.cc: Update.
2001-06-18 Benjamin Kosnik <bkoz@redhat.com> 2001-06-18 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/stl_raw_storage_iter.h: Format. Correct derivation. * include/bits/stl_raw_storage_iter.h: Format. Correct derivation.
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
// the GNU General Public License. // the GNU General Public License.
// //
// ISO C++ 14882: ??? // ISO C++ 14882: 21.4
// //
#ifndef _CPP_CWCHAR #ifndef _CPP_CWCHAR
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/std_cstddef.h> #include <bits/std_cstddef.h>
#include <bits/std_ctime.h>
#if _GLIBCPP_HAVE_WCHAR_H #if _GLIBCPP_HAVE_WCHAR_H
#pragma GCC system_header #pragma GCC system_header
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#undef towupper #undef towupper
#undef towctrans #undef towctrans
#undef wctrans #undef wctrans
#undef wctype
namespace std namespace std
{ {
...@@ -82,6 +83,7 @@ namespace std ...@@ -82,6 +83,7 @@ namespace std
using ::towupper; using ::towupper;
using ::towctrans; using ::towctrans;
using ::wctrans; using ::wctrans;
using ::wctype;
} }
#endif #endif
...@@ -99,9 +99,10 @@ cat <<EOF > $OUT_H-t ...@@ -99,9 +99,10 @@ cat <<EOF > $OUT_H-t
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/std_cfloat.h> #include <bits/std_cfloat.h>
namespace std { namespace std
{
enum float_round_style { enum float_round_style
{
round_indeterminate = -1, round_indeterminate = -1,
round_toward_zero = 0, round_toward_zero = 0,
round_to_nearest = 1, round_to_nearest = 1,
...@@ -109,13 +110,16 @@ namespace std { ...@@ -109,13 +110,16 @@ namespace std {
round_toward_neg_infinity = 3 round_toward_neg_infinity = 3
}; };
enum float_denorm_style { enum float_denorm_style
{
denorm_indeterminate = -1, denorm_indeterminate = -1,
denorm_absent = 0, denorm_absent = 0,
denorm_present = 1 denorm_present = 1
}; };
template<typename _Tp> struct numeric_limits { template<typename _Tp>
struct numeric_limits
{
static const bool is_specialized = false; static const bool is_specialized = false;
static _Tp min() throw() { return static_cast<_Tp>(0); } static _Tp min() throw() { return static_cast<_Tp>(0); }
...@@ -156,6 +160,94 @@ namespace std { ...@@ -156,6 +160,94 @@ namespace std {
static const float_round_style round_style = round_toward_zero; static const float_round_style round_style = round_toward_zero;
}; };
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_specialized;
template<typename _Tp>
const int
numeric_limits<_Tp>::digits;
template<typename _Tp>
const int
numeric_limits<_Tp>::digits10;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_signed;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_integer;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_exact;
template<typename _Tp>
const int
numeric_limits<_Tp>::radix;
template<typename _Tp>
const int
numeric_limits<_Tp>::min_exponent;
template<typename _Tp>
const int
numeric_limits<_Tp>::min_exponent10;
template<typename _Tp>
const int
numeric_limits<_Tp>::max_exponent;
template<typename _Tp>
const int
numeric_limits<_Tp>::max_exponent10;
template<typename _Tp>
const bool
numeric_limits<_Tp>::has_infinity;
template<typename _Tp>
const bool
numeric_limits<_Tp>::has_quiet_NaN;
template<typename _Tp>
const bool
numeric_limits<_Tp>::has_signaling_NaN;
template<typename _Tp>
const float_denorm_style
numeric_limits<_Tp>::has_denorm;
template<typename _Tp>
const bool
numeric_limits<_Tp>::has_denorm_loss;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_iec559;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_bounded;
template<typename _Tp>
const bool
numeric_limits<_Tp>::is_modulo;
template<typename _Tp>
const bool
numeric_limits<_Tp>::traps;
template<typename _Tp>
const bool
numeric_limits<_Tp>::tinyness_before;
template<typename _Tp>
const float_round_style
numeric_limits<_Tp>::round_style;
template<typename _Tp> _Tp __limits_infinity(); template<typename _Tp> _Tp __limits_infinity();
template<typename _Tp> _Tp __limits_quiet_NaN(); template<typename _Tp> _Tp __limits_quiet_NaN();
template<typename _Tp> _Tp __limits_signaling_NaN(); template<typename _Tp> _Tp __limits_signaling_NaN();
...@@ -271,3 +363,5 @@ EOF ...@@ -271,3 +363,5 @@ EOF
mv $OUT_C-t $OUT_C mv $OUT_C-t $OUT_C
mv $OUT_H-t $OUT_H mv $OUT_H-t $OUT_H
...@@ -27,5 +27,8 @@ int main(void) ...@@ -27,5 +27,8 @@ int main(void)
{ {
// Make sure size_t is in namespace std // Make sure size_t is in namespace std
std::size_t i = 5; std::size_t i = 5;
std::tm mytime;
return 0; return 0;
} }
...@@ -22,11 +22,33 @@ ...@@ -22,11 +22,33 @@
#if _GLIBCPP_USE_WCHAR_T #if _GLIBCPP_USE_WCHAR_T
#include <cwctype> #include <cwctype>
// Make sure wint_t is in namespace std // Make sure wint_t is in namespace std
std::wint_t i = 5; std::wint_t i = 5;
// Make sure table 46 is in namespace std.
using std::wctype_t;
using std::wctrans_t;
using std::iswalpha;
using std::iswupper;
using std::iswlower;
using std::iswdigit;
using std::iswxdigit;
using std::iswalnum;
using std::iswspace;
using std::iswpunct;
using std::iswprint;
using std::iswgraph;
using std::iswcntrl;
using std::iswctype;
using std::towctrans;
using std::towlower;
using std::towupper;
using std::wctrans;
using std::wctype;
#endif #endif
int main(void) int main(void)
{ {
return 0; return 0;
} }
// 1999-08-23 bkoz // 1999-08-23 bkoz
// Copyright (C) 1999 Free Software Foundation // Copyright (C) 1999, 2001 Free Software Foundation
// //
// 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
...@@ -80,9 +80,21 @@ bool test01() ...@@ -80,9 +80,21 @@ bool test01()
return test; return test;
} }
// test linkage of the generic bits
void test02()
{
typedef std::numeric_limits<B> b_nl_type;
// Should probably do all of them...
const int* pi1 = &b_nl_type::digits;
const int* pi2 = &b_nl_type::digits10;
const int* pi3 = &b_nl_type::max_exponent10;
const bool* pb1 = &b_nl_type::traps;
}
int main() int main()
{ {
test01(); test01();
test02();
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