This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Cache moneypunct
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 21 Feb 2004 10:28:39 +0100
- Subject: [v3] Cache moneypunct
Hi,
tested x86-linux, gnu/generic locale models.
Paolo.
////////////
2004-02-21 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.h (class money_base): Add { _S_minus,
_S_zero, _S_end } enum, _S_atoms.
(struct __moneypunct_cache<>): Parameterize on _Intl too; add
_M_grouping_size, _M_curr_symbol_size, _M_positive_sign_size,
_M_negative_sign_size, _M_atoms; tweak constructor consistently.
(__moneypunct_cache<>::~__moneypunct_cache): Update.
(__moneypunct_cache<>::_M_cache): Fill the cache.
(class moneypunct): Tweak __cache_type typedef.
(class money_put): Inherit from money_base too; tweak declaration
of _M_insert, now parameterized on _Intl.
* include/bits/locale_facets.tcc
(struct __use_cache<__moneypunct_cache<_CharT, _Intl> >): New.
(money_put<>::_M_insert): Update definition to use the cache;
call reserve on __res to avoid multiple reallocations.
(money_put<>::do_put(long double),
money_put<>::do_put(const string_type&): Update calls of _M_insert.
* config/locale/generic/monetary_members.cc
(moneypunct<char, true>::_M_initialize_moneypunct,
moneypunct<char, false>::_M_initialize_moneypunct,
moneypunct<wchar_t, true>::_M_initialize_moneypunct,
moneypunct<wchar_t, false>::_M_initialize_moneypunct): Update.
* config/locale/gnu/monetary_members.cc: Likewise.
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t, true>::~moneypunct(),
moneypunct<wchar_t, false>::~moneypunct()): Likewise.
* src/globals_locale.cc: Tweak fake_money_cache_c.
* src/locale-inst.cc: Add instantiations for
money_put::_M_insert<false> and money_put::_M_insert<true> and
__moneypunct_cache<C, false>, __moneypunct_cache<C, true>.
* src/locale_facets.cc: Define money_base::_S_atoms.
* src/locale_init.cc: Update placement new of
__moneypunct_cache<char, false>, __moneypunct_cache<char, true>,
__moneypunct_cache<wchar_t, false>, __moneypunct_cache<wchar_T, true>.
* config/locale/generic/numeric_members.cc: Clean up.
* config/locale/gnu/numeric_members.cc: Likewise.
* testsuite/22_locale/money_put/put/char/1.cc: Likewise.
* testsuite/22_locale/money_put/put/char/2.cc: Likewise.
* testsuite/22_locale/money_put/put/char/3.cc: Likewise.
* testsuite/22_locale/money_put/put/wchar_t/1.cc: Likewise.
* testsuite/22_locale/money_put/put/wchar_t/2.cc: Likewise.
* testsuite/22_locale/money_put/put/wchar_t/3.cc: Likewise.
diff -prN libstdc++-v3-orig/config/locale/generic/monetary_members.cc libstdc++-v3/config/locale/generic/monetary_members.cc
*** libstdc++-v3-orig/config/locale/generic/monetary_members.cc Fri Jul 18 04:27:14 2003
--- libstdc++-v3/config/locale/generic/monetary_members.cc Thu Feb 19 19:07:45 2004
***************
*** 1,6 ****
// std::moneypunct implementation details, generic version -*- C++ -*-
! // Copyright (C) 2001, 2002, 2003 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
--- 1,6 ----
// std::moneypunct implementation details, generic version -*- C++ -*-
! // Copyright (C) 2001, 2002, 2003, 2004 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
*************** namespace std
*** 49,65 ****
{
// "C" locale.
if (!_M_data)
! _M_data = new __moneypunct_cache<char>;
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
_M_data->_M_curr_symbol = "";
_M_data->_M_positive_sign = "";
_M_data->_M_negative_sign = "";
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
--- 49,72 ----
{
// "C" locale.
if (!_M_data)
! _M_data = new __moneypunct_cache<char, true>;
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = "";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = "";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = "";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
}
template<>
*************** namespace std
*** 68,84 ****
{
// "C" locale.
if (!_M_data)
! _M_data = new __moneypunct_cache<char>;
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
_M_data->_M_curr_symbol = "";
_M_data->_M_positive_sign = "";
_M_data->_M_negative_sign = "";
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
--- 75,98 ----
{
// "C" locale.
if (!_M_data)
! _M_data = new __moneypunct_cache<char, false>;
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = "";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = "";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = "";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
}
template<>
*************** namespace std
*** 97,113 ****
{
// "C" locale
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t>;
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
_M_data->_M_curr_symbol = L"";
_M_data->_M_positive_sign = L"";
_M_data->_M_negative_sign = L"";
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
--- 111,138 ----
{
// "C" locale
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t, true>;
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = L"";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ unsigned char uc;
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ {
+ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
+ _M_data->_M_atoms[__i] = btowc(uc);
+ }
}
template<>
*************** namespace std
*** 117,133 ****
{
// "C" locale
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t>;
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
_M_data->_M_curr_symbol = L"";
_M_data->_M_positive_sign = L"";
_M_data->_M_negative_sign = L"";
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
}
template<>
--- 142,169 ----
{
// "C" locale
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t, false>;
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = L"";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ unsigned char uc;
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ {
+ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
+ _M_data->_M_atoms[__i] = btowc(uc);
+ }
}
template<>
diff -prN libstdc++-v3-orig/config/locale/generic/numeric_members.cc libstdc++-v3/config/locale/generic/numeric_members.cc
*** libstdc++-v3-orig/config/locale/generic/numeric_members.cc Wed Jan 14 20:14:39 2004
--- libstdc++-v3/config/locale/generic/numeric_members.cc Wed Feb 18 22:55:28 2004
*************** namespace std
*** 46,51 ****
--- 46,52 ----
_M_data = new __numpunct_cache<char>;
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_use_grouping = false;
_M_data->_M_decimal_point = '.';
*************** namespace std
*** 57,64 ****
for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
_M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
- _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-
_M_data->_M_truename = "true";
_M_data->_M_truename_size = strlen(_M_data->_M_truename);
_M_data->_M_falsename = "false";
--- 58,63 ----
*************** namespace std
*** 79,84 ****
--- 78,84 ----
_M_data = new __numpunct_cache<wchar_t>;
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_use_grouping = false;
_M_data->_M_decimal_point = L'.';
*************** namespace std
*** 98,105 ****
_M_data->_M_atoms_in[__i] = btowc(uc);
}
- _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-
_M_data->_M_truename = L"true";
_M_data->_M_truename_size = wcslen(_M_data->_M_truename);
_M_data->_M_falsename = L"false";
--- 98,103 ----
diff -prN libstdc++-v3-orig/config/locale/gnu/monetary_members.cc libstdc++-v3/config/locale/gnu/monetary_members.cc
*** libstdc++-v3-orig/config/locale/gnu/monetary_members.cc Mon Jan 26 00:31:43 2004
--- libstdc++-v3/config/locale/gnu/monetary_members.cc Thu Feb 19 17:58:52 2004
*************** namespace std
*** 210,216 ****
const char*)
{
if (!_M_data)
! _M_data = new __moneypunct_cache<char>;
if (!__cloc)
{
--- 210,216 ----
const char*)
{
if (!_M_data)
! _M_data = new __moneypunct_cache<char, true>;
if (!__cloc)
{
*************** namespace std
*** 218,229 ****
--- 218,236 ----
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = "";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = "";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = "";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
}
else
{
*************** namespace std
*** 233,239 ****
--- 240,248 ----
_M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
__cloc));
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
_M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
if (!__nposn)
*************** namespace std
*** 241,249 ****
--- 250,260 ----
else
_M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
__cloc);
+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
// _Intl == true
_M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
_M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
__cloc));
char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
*************** namespace std
*** 264,270 ****
const char*)
{
if (!_M_data)
! _M_data = new __moneypunct_cache<char>;
if (!__cloc)
{
--- 275,281 ----
const char*)
{
if (!_M_data)
! _M_data = new __moneypunct_cache<char, false>;
if (!__cloc)
{
*************** namespace std
*** 272,283 ****
--- 283,301 ----
_M_data->_M_decimal_point = '.';
_M_data->_M_thousands_sep = ',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = "";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = "";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = "";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
}
else
{
*************** namespace std
*** 287,303 ****
_M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
__cloc));
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
_M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
if (!__nposn)
_M_data->_M_negative_sign = "()";
else
! _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
__cloc);
// _Intl == false
_M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
_M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
--- 305,325 ----
_M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
__cloc));
_M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
_M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
if (!__nposn)
_M_data->_M_negative_sign = "()";
else
! _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
__cloc);
+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
// _Intl == false
_M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
_M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
*************** namespace std
*** 330,336 ****
#endif
{
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t>;
if (!__cloc)
{
--- 352,358 ----
#endif
{
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t, true>;
if (!__cloc)
{
*************** namespace std
*** 338,349 ****
--- 360,383 ----
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = L"";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ // Use ctype::widen code without the facet...
+ unsigned char uc;
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ {
+ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
+ _M_data->_M_atoms[__i] = btowc(uc);
+ }
}
else
{
*************** namespace std
*** 363,368 ****
--- 397,403 ----
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
_M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
*************** namespace std
*** 385,390 ****
--- 420,426 ----
}
else
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
__len = strlen(__cnegsign);
if (!__nposn)
*************** namespace std
*** 399,404 ****
--- 435,441 ----
}
else
_M_data->_M_negative_sign = L"";
+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
// _Intl == true.
__len = strlen(__ccurr);
*************** namespace std
*** 412,417 ****
--- 449,455 ----
}
else
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
}
catch (...)
{
*************** namespace std
*** 459,465 ****
#endif
{
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t>;
if (!__cloc)
{
--- 497,503 ----
#endif
{
if (!_M_data)
! _M_data = new __moneypunct_cache<wchar_t, false>;
if (!__cloc)
{
*************** namespace std
*** 467,478 ****
--- 505,528 ----
_M_data->_M_decimal_point = L'.';
_M_data->_M_thousands_sep = L',';
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = 0;
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = 0;
_M_data->_M_negative_sign = L"";
+ _M_data->_M_negative_sign_size = 0;
_M_data->_M_frac_digits = 0;
_M_data->_M_pos_format = money_base::_S_default_pattern;
_M_data->_M_neg_format = money_base::_S_default_pattern;
+
+ // Use ctype::widen code without the facet...
+ unsigned char uc;
+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
+ {
+ uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
+ _M_data->_M_atoms[__i] = btowc(uc);
+ }
}
else
{
*************** namespace std
*** 492,497 ****
--- 542,548 ----
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
_M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
*************** namespace std
*** 515,520 ****
--- 566,572 ----
}
else
_M_data->_M_positive_sign = L"";
+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
__len = strlen(__cnegsign);
if (!__nposn)
*************** namespace std
*** 529,535 ****
}
else
_M_data->_M_negative_sign = L"";
!
// _Intl == true.
__len = strlen(__ccurr);
if (__len)
--- 581,588 ----
}
else
_M_data->_M_negative_sign = L"";
! _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
!
// _Intl == true.
__len = strlen(__ccurr);
if (__len)
*************** namespace std
*** 542,547 ****
--- 595,601 ----
}
else
_M_data->_M_curr_symbol = L"";
+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
}
catch (...)
{
*************** namespace std
*** 581,592 ****
template<>
moneypunct<wchar_t, true>::~moneypunct()
{
! if (wcslen(_M_data->_M_positive_sign))
delete [] _M_data->_M_positive_sign;
! if (wcslen(_M_data->_M_negative_sign)
! && (wcscmp(_M_data->_M_negative_sign, L"()") != 0))
delete [] _M_data->_M_negative_sign;
! if (wcslen(_M_data->_M_curr_symbol))
delete [] _M_data->_M_curr_symbol;
delete _M_data;
}
--- 635,646 ----
template<>
moneypunct<wchar_t, true>::~moneypunct()
{
! if (_M_data->_M_positive_sign_size)
delete [] _M_data->_M_positive_sign;
! if (_M_data->_M_negative_sign_size
! && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
delete [] _M_data->_M_negative_sign;
! if (_M_data->_M_curr_symbol_size)
delete [] _M_data->_M_curr_symbol;
delete _M_data;
}
*************** namespace std
*** 594,605 ****
template<>
moneypunct<wchar_t, false>::~moneypunct()
{
! if (wcslen(_M_data->_M_positive_sign))
delete [] _M_data->_M_positive_sign;
! if (wcslen(_M_data->_M_negative_sign)
! && (wcscmp(_M_data->_M_negative_sign, L"()") != 0))
delete [] _M_data->_M_negative_sign;
! if (wcslen(_M_data->_M_curr_symbol))
delete [] _M_data->_M_curr_symbol;
delete _M_data;
}
--- 648,659 ----
template<>
moneypunct<wchar_t, false>::~moneypunct()
{
! if (_M_data->_M_positive_sign_size)
delete [] _M_data->_M_positive_sign;
! if (_M_data->_M_negative_sign_size
! && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
delete [] _M_data->_M_negative_sign;
! if (_M_data->_M_curr_symbol_size)
delete [] _M_data->_M_curr_symbol;
delete _M_data;
}
diff -prN libstdc++-v3-orig/config/locale/gnu/numeric_members.cc libstdc++-v3/config/locale/gnu/numeric_members.cc
*** libstdc++-v3-orig/config/locale/gnu/numeric_members.cc Wed Jan 14 20:14:38 2004
--- libstdc++-v3/config/locale/gnu/numeric_members.cc Wed Feb 18 22:52:14 2004
*************** namespace std
*** 49,54 ****
--- 49,55 ----
{
// "C" locale
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_use_grouping = false;
_M_data->_M_decimal_point = '.';
*************** namespace std
*** 71,78 ****
_M_data->_M_grouping = "";
else
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
- _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
--- 72,79 ----
_M_data->_M_grouping = "";
else
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
*************** namespace std
*** 99,104 ****
--- 100,106 ----
{
// "C" locale
_M_data->_M_grouping = "";
+ _M_data->_M_grouping_size = 0;
_M_data->_M_use_grouping = false;
_M_data->_M_decimal_point = L'.';
*************** namespace std
*** 138,145 ****
_M_data->_M_grouping = "";
else
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
- _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
--- 140,147 ----
_M_data->_M_grouping = "";
else
_M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
diff -prN libstdc++-v3-orig/include/bits/locale_facets.h libstdc++-v3/include/bits/locale_facets.h
*** libstdc++-v3-orig/include/bits/locale_facets.h Wed Feb 18 11:33:19 2004
--- libstdc++-v3/include/bits/locale_facets.h Thu Feb 19 21:15:20 2004
*************** namespace std
*** 3464,3495 ****
static const pattern _S_default_pattern;
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
static pattern
_S_construct_pattern(char __precedes, char __space, char __posn);
};
! template<typename _CharT>
struct __moneypunct_cache : public locale::facet
{
const char* _M_grouping;
bool _M_use_grouping;
_CharT _M_decimal_point;
_CharT _M_thousands_sep;
const _CharT* _M_curr_symbol;
const _CharT* _M_positive_sign;
const _CharT* _M_negative_sign;
int _M_frac_digits;
money_base::pattern _M_pos_format;
money_base::pattern _M_neg_format;
bool _M_allocated;
__moneypunct_cache(size_t __refs = 0) : facet(__refs),
! _M_grouping(NULL), _M_use_grouping(false), _M_decimal_point(_CharT()),
! _M_thousands_sep(_CharT()), _M_curr_symbol(NULL), _M_positive_sign(NULL),
! _M_negative_sign(NULL), _M_frac_digits(0),
_M_pos_format(money_base::pattern()),
_M_neg_format(money_base::pattern()), _M_allocated(false)
{ }
--- 3464,3518 ----
static const pattern _S_default_pattern;
+ enum
+ {
+ _S_minus,
+ _S_zero,
+ _S_end = 11
+ };
+
+ // String literal of acceptable (narrow) input/output, for
+ // money_get/money_put. "-0123456789"
+ static const char* _S_atoms;
+
// Construct and return valid pattern consisting of some combination of:
// space none symbol sign value
static pattern
_S_construct_pattern(char __precedes, char __space, char __posn);
};
! template<typename _CharT, bool _Intl>
struct __moneypunct_cache : public locale::facet
{
const char* _M_grouping;
+ size_t _M_grouping_size;
bool _M_use_grouping;
_CharT _M_decimal_point;
_CharT _M_thousands_sep;
const _CharT* _M_curr_symbol;
+ size_t _M_curr_symbol_size;
const _CharT* _M_positive_sign;
+ size_t _M_positive_sign_size;
const _CharT* _M_negative_sign;
+ size_t _M_negative_sign_size;
int _M_frac_digits;
money_base::pattern _M_pos_format;
money_base::pattern _M_neg_format;
+ // A list of valid numeric literals for input and output: in the standard
+ // "C" locale, this is "-0123456789". This array contains the chars after
+ // having been passed through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms[money_base::_S_end];
+
bool _M_allocated;
__moneypunct_cache(size_t __refs = 0) : facet(__refs),
! _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
! _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()),
! _M_curr_symbol(NULL), _M_curr_symbol_size(0),
! _M_positive_sign(NULL), _M_positive_sign_size(0),
! _M_negative_sign(NULL), _M_negative_sign_size(0),
! _M_frac_digits(0),
_M_pos_format(money_base::pattern()),
_M_neg_format(money_base::pattern()), _M_allocated(false)
{ }
*************** namespace std
*** 3500,3514 ****
_M_cache(const locale& __loc);
};
! template<typename _CharT>
! __moneypunct_cache<_CharT>::~__moneypunct_cache()
{
if (_M_allocated)
{
! // XXX.
}
}
/**
* @brief Facet for formatting data for money amounts.
*
--- 3523,3582 ----
_M_cache(const locale& __loc);
};
! template<typename _CharT, bool _Intl>
! __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache()
{
if (_M_allocated)
{
! delete [] _M_grouping;
! delete [] _M_curr_symbol;
! delete [] _M_positive_sign;
! delete [] _M_negative_sign;
}
}
+ template<typename _CharT, bool _Intl>
+ void
+ __moneypunct_cache<_CharT, _Intl>::_M_cache(const locale& __loc)
+ {
+ _M_allocated = true;
+
+ const moneypunct<_CharT, _Intl>& __mp =
+ use_facet<moneypunct<_CharT, _Intl> >(__loc);
+
+ _M_grouping_size = __mp.grouping().size();
+ char* __grouping = new char[_M_grouping_size];
+ __mp.grouping().copy(__grouping, _M_grouping_size);
+ _M_grouping = __grouping;
+ _M_use_grouping = _M_grouping_size && __mp.grouping()[0] != 0;
+
+ _M_decimal_point = __mp.decimal_point();
+ _M_thousands_sep = __mp.thousands_sep();
+ _M_frac_digits = __mp.frac_digits();
+
+ _M_curr_symbol_size = __mp.curr_symbol().size();
+ _CharT* __curr_symbol = new _CharT[_M_curr_symbol_size];
+ __mp.curr_symbol().copy(__curr_symbol, _M_curr_symbol_size);
+ _M_curr_symbol = __curr_symbol;
+
+ _M_positive_sign_size = __mp.positive_sign().size();
+ _CharT* __positive_sign = new _CharT[_M_positive_sign_size];
+ __mp.positive_sign().copy(__positive_sign, _M_positive_sign_size);
+ _M_positive_sign = __positive_sign;
+
+ _M_negative_sign_size = __mp.negative_sign().size();
+ _CharT* __negative_sign = new _CharT[_M_negative_sign_size];
+ __mp.negative_sign().copy(__negative_sign, _M_negative_sign_size);
+ _M_negative_sign = __negative_sign;
+
+ _M_pos_format = __mp.pos_format();
+ _M_neg_format = __mp.neg_format();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(money_base::_S_atoms,
+ money_base::_S_atoms + money_base::_S_end, _M_atoms);
+ }
+
/**
* @brief Facet for formatting data for money amounts.
*
*************** namespace std
*** 3525,3531 ****
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
//@}
! typedef __moneypunct_cache<_CharT> __cache_type;
private:
__cache_type* _M_data;
--- 3593,3599 ----
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
//@}
! typedef __moneypunct_cache<_CharT, _Intl> __cache_type;
private:
__cache_type* _M_data;
*************** namespace std
*** 4078,4084 ****
* the money_put facet.
*/
template<typename _CharT, typename _OutIter>
! class money_put : public locale::facet
{
public:
//@{
--- 4146,4152 ----
* the money_put facet.
*/
template<typename _CharT, typename _OutIter>
! class money_put : public locale::facet, public money_base
{
public:
//@{
*************** namespace std
*** 4194,4202 ****
do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
const string_type& __digits) const;
! iter_type
! _M_insert(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
! const string_type& __digits) const;
};
template<typename _CharT, typename _OutIter>
--- 4262,4271 ----
do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
const string_type& __digits) const;
! template<bool _Intl>
! iter_type
! _M_insert(iter_type __s, ios_base& __io, char_type __fill,
! const string_type& __digits) const;
};
template<typename _CharT, typename _OutIter>
diff -prN libstdc++-v3-orig/include/bits/locale_facets.tcc libstdc++-v3/include/bits/locale_facets.tcc
*** libstdc++-v3-orig/include/bits/locale_facets.tcc Wed Feb 18 11:32:25 2004
--- libstdc++-v3/include/bits/locale_facets.tcc Thu Feb 19 21:47:11 2004
*************** namespace std
*** 1130,1135 ****
--- 1130,1163 ----
return __s;
}
+ template<typename _CharT, bool _Intl>
+ struct __use_cache<__moneypunct_cache<_CharT, _Intl> >
+ {
+ const __moneypunct_cache<_CharT, _Intl>*
+ operator() (const locale& __loc) const
+ {
+ const size_t __i = moneypunct<_CharT, _Intl>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __moneypunct_cache<_CharT, _Intl>* __tmp = NULL;
+ try
+ {
+ __tmp = new __moneypunct_cache<_CharT, _Intl>;
+ __tmp->_M_cache(__loc);
+ }
+ catch(...)
+ {
+ delete __tmp;
+ __throw_exception_again;
+ }
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<
+ const __moneypunct_cache<_CharT, _Intl>*>(__caches[__i]);
+ }
+ };
+
template<typename _CharT, typename _InIter>
_InIter
money_get<_CharT, _InIter>::
*************** namespace std
*** 1365,1532 ****
{ return _M_extract(__beg, __end, __intl, __io, __err, __units); }
template<typename _CharT, typename _OutIter>
! _OutIter
! money_put<_CharT, _OutIter>::
! _M_insert(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
! const string_type& __digits) const
! {
! typedef typename string_type::size_type size_type;
! typedef money_base::part part;
! const locale __loc = __io.getloc();
! const size_type __width = static_cast<size_type>(__io.width());
!
! // These contortions are quite unfortunate.
! typedef moneypunct<_CharT, true> __money_true;
! typedef moneypunct<_CharT, false> __money_false;
! const __money_true& __mpt = use_facet<__money_true>(__loc);
! const __money_false& __mpf = use_facet<__money_false>(__loc);
! const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
!
! // Determine if negative or positive formats are to be used, and
! // discard leading negative_sign if it is present.
! const char_type* __beg = __digits.data();
! const char_type* __end = __beg + __digits.size();
! money_base::pattern __p;
! string_type __sign;
! if (*__beg != __ctype.widen('-'))
! {
! __p = __intl ? __mpt.pos_format() : __mpf.pos_format();
! __sign = __intl ? __mpt.positive_sign() : __mpf.positive_sign();
! }
! else
! {
! __p = __intl ? __mpt.neg_format() : __mpf.neg_format();
! __sign = __intl ? __mpt.negative_sign() : __mpf.negative_sign();
! ++__beg;
! }
!
! // Look for valid numbers in the current ctype facet within input digits.
! __end = __ctype.scan_not(ctype_base::digit, __beg, __end);
! if (__beg != __end)
! {
! // Assume valid input, and attempt to format.
! // Break down input numbers into base components, as follows:
! // final_value = grouped units + (decimal point) + (digits)
! string_type __res;
! string_type __value;
! const string_type __symbol = __intl ? __mpt.curr_symbol()
! : __mpf.curr_symbol();
!
! // Deal with decimal point, decimal digits.
! const int __frac = __intl ? __mpt.frac_digits()
! : __mpf.frac_digits();
! if (__frac > 0)
! {
! const char_type __d = __intl ? __mpt.decimal_point()
! : __mpf.decimal_point();
! if (__end - __beg >= __frac)
! {
! __value = string_type(__end - __frac, __end);
! __value.insert(__value.begin(), __d);
! __end -= __frac;
! }
! else
! {
! // Have to pad zeros in the decimal position.
! __value = string_type(__beg, __end);
! const int __paddec = __frac - (__end - __beg);
! const char_type __zero = __ctype.widen('0');
! __value.insert(__value.begin(), __paddec, __zero);
! __value.insert(__value.begin(), __d);
! __beg = __end;
! }
! }
!
! // Add thousands separators to non-decimal digits, per
! // grouping rules.
! if (__beg != __end)
! {
! const string __grouping = __intl ? __mpt.grouping()
! : __mpf.grouping();
! if (__grouping.size())
! {
! const char_type __sep = __intl ? __mpt.thousands_sep()
! : __mpf.thousands_sep();
! const char* __gbeg = __grouping.data();
! const size_t __glen = __grouping.size();
! const int __n = (__end - __beg) * 2;
! _CharT* __ws2 =
! static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __n));
! _CharT* __ws_end = std::__add_grouping(__ws2, __sep, __gbeg,
! __glen, __beg, __end);
! __value.insert(0, __ws2, __ws_end - __ws2);
! }
! else
! __value.insert(0, string_type(__beg, __end));
! }
!
! // Calculate length of resulting string.
! const ios_base::fmtflags __f = __io.flags() & ios_base::adjustfield;
! size_type __len = __value.size() + __sign.size();
! __len += (__io.flags() & ios_base::showbase) ? __symbol.size() : 0;
! const bool __testipad = __f == ios_base::internal && __len < __width;
!
! // Fit formatted digits into the required pattern.
! for (int __i = 0; __i < 4; ++__i)
! {
! const part __which = static_cast<part>(__p.field[__i]);
! switch (__which)
! {
! case money_base::symbol:
! if (__io.flags() & ios_base::showbase)
! __res += __symbol;
! break;
! case money_base::sign:
! // Sign might not exist, or be more than one
! // charater long. In that case, add in the rest
! // below.
! if (__sign.size())
! __res += __sign[0];
! break;
! case money_base::value:
! __res += __value;
! break;
! case money_base::space:
! // At least one space is required, but if internal
! // formatting is required, an arbitrary number of
! // fill spaces will be necessary.
! if (__testipad)
! __res += string_type(__width - __len, __fill);
! else
! __res += __ctype.widen(__fill);
! break;
! case money_base::none:
! if (__testipad)
! __res += string_type(__width - __len, __fill);
! break;
! }
! }
!
! // Special case of multi-part sign parts.
! if (__sign.size() > 1)
! __res += string_type(__sign.begin() + 1, __sign.end());
!
! // Pad, if still necessary.
! __len = __res.size();
! if (__width > __len)
! {
! if (__f == ios_base::left)
! // After.
! __res.append(__width - __len, __fill);
! else
! // Before.
! __res.insert(0, string_type(__width - __len, __fill));
! __len = __width;
! }
!
! // Write resulting, fully-formatted string to output iterator.
! __s = std::__write(__s, __res.data(), __len);
! }
! __io.width(0);
! return __s;
! }
template<typename _CharT, typename _OutIter>
_OutIter
money_put<_CharT, _OutIter>::
--- 1393,1560 ----
{ return _M_extract(__beg, __end, __intl, __io, __err, __units); }
template<typename _CharT, typename _OutIter>
! template<bool _Intl>
! _OutIter
! money_put<_CharT, _OutIter>::
! _M_insert(iter_type __s, ios_base& __io, char_type __fill,
! const string_type& __digits) const
! {
! typedef typename string_type::size_type size_type;
! typedef money_base::part part;
! typedef moneypunct<_CharT, _Intl> __moneypunct_type;
! typedef typename __moneypunct_type::__cache_type __cache_type;
! const locale& __loc = __io._M_getloc();
! const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+ __use_cache<__cache_type> __uc;
+ const __cache_type* __lc = __uc(__loc);
+ const char_type* __lit = __lc->_M_atoms;
+
+ // Determine if negative or positive formats are to be used, and
+ // discard leading negative_sign if it is present.
+ const char_type* __beg = __digits.data();
+ const char_type* __end = __beg + __digits.size();
+
+ money_base::pattern __p;
+ const char_type* __sign;
+ size_t __sign_size;
+ if (*__beg != __lit[_S_minus])
+ {
+ __p = __lc->_M_pos_format;
+ __sign = __lc->_M_positive_sign;
+ __sign_size = __lc->_M_positive_sign_size;
+ }
+ else
+ {
+ __p = __lc->_M_neg_format;
+ __sign = __lc->_M_negative_sign;
+ __sign_size = __lc->_M_negative_sign_size;
+ ++__beg;
+ }
+
+ // Look for valid numbers in the ctype facet within input digits.
+ __end = __ctype.scan_not(ctype_base::digit, __beg, __end);
+ if (__beg != __end)
+ {
+ // Assume valid input, and attempt to format.
+ // Break down input numbers into base components, as follows:
+ // final_value = grouped units + (decimal point) + (digits)
+ string_type __res;
+ string_type __value;
+
+ // Deal with decimal point, decimal digits.
+ if (__lc->_M_frac_digits > 0)
+ {
+ if (__end - __beg >= __lc->_M_frac_digits)
+ {
+ __value = string_type(__end - __lc->_M_frac_digits, __end);
+ __value.insert(__value.begin(), __lc->_M_decimal_point);
+ __end -= __lc->_M_frac_digits;
+ }
+ else
+ {
+ // Have to pad zeros in the decimal position.
+ __value = string_type(__beg, __end);
+ const int __paddec = __lc->_M_frac_digits - (__end - __beg);
+ __value.insert(__value.begin(), __paddec, __lit[_S_zero]);
+ __value.insert(__value.begin(), __lc->_M_decimal_point);
+ __beg = __end;
+ }
+ }
+
+ // Add thousands separators to non-decimal digits, per
+ // grouping rules.
+ if (__beg != __end)
+ {
+ if (__lc->_M_grouping_size)
+ {
+ const int __n = (__end - __beg) * 2;
+ _CharT* __ws2 =
+ static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __n));
+ _CharT* __ws_end =
+ std::__add_grouping(__ws2, __lc->_M_thousands_sep,
+ __lc->_M_grouping,
+ __lc->_M_grouping_size,
+ __beg, __end);
+ __value.insert(0, __ws2, __ws_end - __ws2);
+ }
+ else
+ __value.insert(0, string_type(__beg, __end));
+ }
+
+ // Calculate length of resulting string.
+ const ios_base::fmtflags __f = __io.flags() & ios_base::adjustfield;
+ size_type __len = __value.size() + __sign_size;
+ __len += ((__io.flags() & ios_base::showbase)
+ ? __lc->_M_curr_symbol_size : 0);
+ __res.reserve(__len);
+
+ const size_type __width = static_cast<size_type>(__io.width());
+ const bool __testipad = (__f == ios_base::internal
+ && __len < __width);
+ // Fit formatted digits into the required pattern.
+ for (int __i = 0; __i < 4; ++__i)
+ {
+ const part __which = static_cast<part>(__p.field[__i]);
+ switch (__which)
+ {
+ case money_base::symbol:
+ if (__io.flags() & ios_base::showbase)
+ __res.append(__lc->_M_curr_symbol,
+ __lc->_M_curr_symbol_size);
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one
+ // charater long. In that case, add in the rest
+ // below.
+ if (__sign_size)
+ __res += __sign[0];
+ break;
+ case money_base::value:
+ __res += __value;
+ break;
+ case money_base::space:
+ // At least one space is required, but if internal
+ // formatting is required, an arbitrary number of
+ // fill spaces will be necessary.
+ if (__testipad)
+ __res += string_type(__width - __len, __fill);
+ else
+ __res += __fill;
+ break;
+ case money_base::none:
+ if (__testipad)
+ __res += string_type(__width - __len, __fill);
+ break;
+ }
+ }
+
+ // Special case of multi-part sign parts.
+ if (__sign_size > 1)
+ __res.append(__sign + 1, __sign_size - 1);
+
+ // Pad, if still necessary.
+ __len = __res.size();
+ if (__width > __len)
+ {
+ if (__f == ios_base::left)
+ // After.
+ __res.append(__width - __len, __fill);
+ else
+ // Before.
+ __res.insert(0, string_type(__width - __len, __fill));
+ __len = __width;
+ }
+
+ // Write resulting, fully-formatted string to output iterator.
+ __s = std::__write(__s, __res.data(), __len);
+ }
+ __io.width(0);
+ return __s;
+ }
+
template<typename _CharT, typename _OutIter>
_OutIter
money_put<_CharT, _OutIter>::
*************** namespace std
*** 1562,1568 ****
* __cs_size));
__ctype.widen(__cs, __cs + __len, __ws);
const string_type __digits(__ws, __len);
! return _M_insert(__s, __intl, __io, __fill, __digits);
}
template<typename _CharT, typename _OutIter>
--- 1590,1597 ----
* __cs_size));
__ctype.widen(__cs, __cs + __len, __ws);
const string_type __digits(__ws, __len);
! return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
! : _M_insert<false>(__s, __io, __fill, __digits);
}
template<typename _CharT, typename _OutIter>
*************** namespace std
*** 1570,1576 ****
money_put<_CharT, _OutIter>::
do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
const string_type& __digits) const
! { return _M_insert(__s, __intl, __io, __fill, __digits); }
// NB: Not especially useful. Without an ios_base object or some
// kind of locale reference, we are left clawing at the air where
--- 1599,1606 ----
money_put<_CharT, _OutIter>::
do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill,
const string_type& __digits) const
! { return __intl ? _M_insert<true>(__s, __io, __fill, __digits)
! : _M_insert<false>(__s, __io, __fill, __digits); }
// NB: Not especially useful. Without an ios_base object or some
// kind of locale reference, we are left clawing at the air where
diff -prN libstdc++-v3-orig/src/globals_locale.cc libstdc++-v3/src/globals_locale.cc
*** libstdc++-v3-orig/src/globals_locale.cc Wed Jan 28 22:20:42 2004
--- libstdc++-v3/src/globals_locale.cc Thu Feb 19 18:39:32 2004
*************** namespace __gnu_internal
*** 184,191 ****
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<char>))));
fake_num_cache_c numpunct_cache_c;
! typedef char fake_money_cache_c[sizeof(std::__moneypunct_cache<char>)]
! __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<char>))));
fake_money_cache_c moneypunct_cache_ct;
fake_money_cache_c moneypunct_cache_cf;
--- 184,191 ----
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<char>))));
fake_num_cache_c numpunct_cache_c;
! typedef char fake_money_cache_c[sizeof(std::__moneypunct_cache<char, true>)]
! __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<char, true>))));
fake_money_cache_c moneypunct_cache_ct;
fake_money_cache_c moneypunct_cache_cf;
*************** namespace __gnu_internal
*** 198,205 ****
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<wchar_t>))));
fake_num_cache_w numpunct_cache_w;
! typedef char fake_money_cache_w[sizeof(std::__moneypunct_cache<wchar_t>)]
! __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<wchar_t>))));
fake_money_cache_w moneypunct_cache_wt;
fake_money_cache_w moneypunct_cache_wf;
--- 198,205 ----
__attribute__ ((aligned(__alignof__(std::__numpunct_cache<wchar_t>))));
fake_num_cache_w numpunct_cache_w;
! typedef char fake_money_cache_w[sizeof(std::__moneypunct_cache<wchar_t,true>)]
! __attribute__ ((aligned(__alignof__(std::__moneypunct_cache<wchar_t,true>))));
fake_money_cache_w moneypunct_cache_wt;
fake_money_cache_w moneypunct_cache_wf;
diff -prN libstdc++-v3-orig/src/locale-inst.cc libstdc++-v3/src/locale-inst.cc
*** libstdc++-v3-orig/src/locale-inst.cc Wed Jan 14 20:14:39 2004
--- libstdc++-v3/src/locale-inst.cc Thu Feb 19 18:59:18 2004
***************
*** 1,6 ****
// Locale support -*- C++ -*-
! // Copyright (C) 1999, 2000, 2001, 2002, 2003 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
--- 1,7 ----
// Locale support -*- C++ -*-
! // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
! // 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
*************** namespace std
*** 43,53 ****
// moneypunct, money_get, and money_put
template class moneypunct<C, false>;
template class moneypunct<C, true>;
! template struct __moneypunct_cache<C>;
template class moneypunct_byname<C, false>;
template class moneypunct_byname<C, true>;
template class money_get<C, istreambuf_iterator<C> >;
template class money_put<C, ostreambuf_iterator<C> >;
// numpunct, numpunct_byname, num_get, and num_put
template class numpunct<C>;
--- 44,66 ----
// moneypunct, money_get, and money_put
template class moneypunct<C, false>;
template class moneypunct<C, true>;
! template struct __moneypunct_cache<C, false>;
! template struct __moneypunct_cache<C, true>;
template class moneypunct_byname<C, false>;
template class moneypunct_byname<C, true>;
template class money_get<C, istreambuf_iterator<C> >;
template class money_put<C, ostreambuf_iterator<C> >;
+ template
+ ostreambuf_iterator<C>
+ money_put<C, ostreambuf_iterator<C> >::
+ _M_insert<true>(ostreambuf_iterator<C>, ios_base&, C,
+ const string_type&) const;
+
+ template
+ ostreambuf_iterator<C>
+ money_put<C, ostreambuf_iterator<C> >::
+ _M_insert<false>(ostreambuf_iterator<C>, ios_base&, C,
+ const string_type&) const;
// numpunct, numpunct_byname, num_get, and num_put
template class numpunct<C>;
diff -prN libstdc++-v3-orig/src/locale_facets.cc libstdc++-v3/src/locale_facets.cc
*** libstdc++-v3-orig/src/locale_facets.cc Mon Dec 8 16:37:03 2003
--- libstdc++-v3/src/locale_facets.cc Thu Feb 19 18:59:46 2004
***************
*** 1,4 ****
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
--- 1,4 ----
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
*************** namespace std
*** 53,58 ****
--- 53,60 ----
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };
+ const char* money_base::_S_atoms = "-0123456789";
+
const char* __num_base::_S_atoms_in = "-+xX0123456789abcdefABCDEF";
const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF";
diff -prN libstdc++-v3-orig/src/locale_init.cc libstdc++-v3/src/locale_init.cc
*** libstdc++-v3-orig/src/locale_init.cc Tue Feb 10 00:10:46 2004
--- libstdc++-v3/src/locale_init.cc Thu Feb 19 16:54:19 2004
*************** namespace __gnu_internal
*** 45,92 ****
extern char* name_vec[6 + _GLIBCXX_NUM_CATEGORIES];
extern char name_c[6 + _GLIBCXX_NUM_CATEGORIES][2];
! extern std::ctype<char> ctype_c;
! extern std::collate<char> collate_c;
! extern std::numpunct<char> numpunct_c;
! extern std::num_get<char> num_get_c;
! extern std::num_put<char> num_put_c;
! extern std::codecvt<char, char, mbstate_t> codecvt_c;
! extern std::moneypunct<char, false> moneypunct_cf;
! extern std::moneypunct<char, true> moneypunct_ct;
! extern std::money_get<char> money_get_c;
! extern std::money_put<char> money_put_c;
! extern std::__timepunct<char> timepunct_c;
! extern std::time_get<char> time_get_c;
! extern std::time_put<char> time_put_c;
! extern std::messages<char> messages_c;
#ifdef _GLIBCXX_USE_WCHAR_T
! extern std::ctype<wchar_t> ctype_w;
! extern std::collate<wchar_t> collate_w;
! extern std::numpunct<wchar_t> numpunct_w;
! extern std::num_get<wchar_t> num_get_w;
! extern std::num_put<wchar_t> num_put_w;
! extern std::codecvt<wchar_t, char, mbstate_t> codecvt_w;
! extern std::moneypunct<wchar_t, false> moneypunct_wf;
! extern std::moneypunct<wchar_t, true> moneypunct_wt;
! extern std::money_get<wchar_t> money_get_w;
! extern std::money_put<wchar_t> money_put_w;
! extern std::__timepunct<wchar_t> timepunct_w;
! extern std::time_get<wchar_t> time_get_w;
! extern std::time_put<wchar_t> time_put_w;
! extern std::messages<wchar_t> messages_w;
#endif
// And the caches....
extern std::locale::facet* cache_vec[_GLIBCXX_NUM_FACETS];
! extern std::__numpunct_cache<char> numpunct_cache_c;
! extern std::__moneypunct_cache<char> moneypunct_cache_cf;
! extern std::__moneypunct_cache<char> moneypunct_cache_ct;
! extern std::__timepunct_cache<char> timepunct_cache_c;
#ifdef _GLIBCXX_USE_WCHAR_T
! extern std::__numpunct_cache<wchar_t> numpunct_cache_w;
! extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wf;
! extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wt;
! extern std::__timepunct_cache<wchar_t> timepunct_cache_w;
#endif
} // namespace __gnu_internal
--- 45,92 ----
extern char* name_vec[6 + _GLIBCXX_NUM_CATEGORIES];
extern char name_c[6 + _GLIBCXX_NUM_CATEGORIES][2];
! extern std::ctype<char> ctype_c;
! extern std::collate<char> collate_c;
! extern std::numpunct<char> numpunct_c;
! extern std::num_get<char> num_get_c;
! extern std::num_put<char> num_put_c;
! extern std::codecvt<char, char, mbstate_t> codecvt_c;
! extern std::moneypunct<char, false> moneypunct_cf;
! extern std::moneypunct<char, true> moneypunct_ct;
! extern std::money_get<char> money_get_c;
! extern std::money_put<char> money_put_c;
! extern std::__timepunct<char> timepunct_c;
! extern std::time_get<char> time_get_c;
! extern std::time_put<char> time_put_c;
! extern std::messages<char> messages_c;
#ifdef _GLIBCXX_USE_WCHAR_T
! extern std::ctype<wchar_t> ctype_w;
! extern std::collate<wchar_t> collate_w;
! extern std::numpunct<wchar_t> numpunct_w;
! extern std::num_get<wchar_t> num_get_w;
! extern std::num_put<wchar_t> num_put_w;
! extern std::codecvt<wchar_t, char, mbstate_t> codecvt_w;
! extern std::moneypunct<wchar_t, false> moneypunct_wf;
! extern std::moneypunct<wchar_t, true> moneypunct_wt;
! extern std::money_get<wchar_t> money_get_w;
! extern std::money_put<wchar_t> money_put_w;
! extern std::__timepunct<wchar_t> timepunct_w;
! extern std::time_get<wchar_t> time_get_w;
! extern std::time_put<wchar_t> time_put_w;
! extern std::messages<wchar_t> messages_w;
#endif
// And the caches....
extern std::locale::facet* cache_vec[_GLIBCXX_NUM_FACETS];
! extern std::__numpunct_cache<char> numpunct_cache_c;
! extern std::__moneypunct_cache<char, false> moneypunct_cache_cf;
! extern std::__moneypunct_cache<char, true> moneypunct_cache_ct;
! extern std::__timepunct_cache<char> timepunct_cache_c;
#ifdef _GLIBCXX_USE_WCHAR_T
! extern std::__numpunct_cache<wchar_t> numpunct_cache_w;
! extern std::__moneypunct_cache<wchar_t, false> moneypunct_cache_wf;
! extern std::__moneypunct_cache<wchar_t, true> moneypunct_cache_wt;
! extern std::__timepunct_cache<wchar_t> timepunct_cache_w;
#endif
} // namespace __gnu_internal
*************** namespace std
*** 273,282 ****
_M_init_facet(new (&num_put_c) num_put<char>(1));
_M_init_facet(new (&collate_c) std::collate<char>(1));
! typedef __moneypunct_cache<char> money_cache_c;
! money_cache_c* __mpcf = new (&moneypunct_cache_cf) money_cache_c(2);
_M_init_facet(new (&moneypunct_cf) moneypunct<char, false>(__mpcf, 1));
! money_cache_c* __mpct = new (&moneypunct_cache_ct) money_cache_c(2);
_M_init_facet(new (&moneypunct_ct) moneypunct<char, true>(__mpct, 1));
_M_init_facet(new (&money_get_c) money_get<char>(1));
--- 273,283 ----
_M_init_facet(new (&num_put_c) num_put<char>(1));
_M_init_facet(new (&collate_c) std::collate<char>(1));
! typedef __moneypunct_cache<char, false> money_cache_cf;
! typedef __moneypunct_cache<char, true> money_cache_ct;
! money_cache_cf* __mpcf = new (&moneypunct_cache_cf) money_cache_cf(2);
_M_init_facet(new (&moneypunct_cf) moneypunct<char, false>(__mpcf, 1));
! money_cache_ct* __mpct = new (&moneypunct_cache_ct) money_cache_ct(2);
_M_init_facet(new (&moneypunct_ct) moneypunct<char, true>(__mpct, 1));
_M_init_facet(new (&money_get_c) money_get<char>(1));
*************** namespace std
*** 302,311 ****
_M_init_facet(new (&num_put_w) num_put<wchar_t>(1));
_M_init_facet(new (&collate_w) std::collate<wchar_t>(1));
! typedef __moneypunct_cache<wchar_t> money_cache_w;
! money_cache_w* __mpwf = new (&moneypunct_cache_wf) money_cache_w(2);
_M_init_facet(new (&moneypunct_wf) moneypunct<wchar_t, false>(__mpwf, 1));
! money_cache_w* __mpwt = new (&moneypunct_cache_wt) money_cache_w(2);
_M_init_facet(new (&moneypunct_wt) moneypunct<wchar_t, true>(__mpwt, 1));
_M_init_facet(new (&money_get_w) money_get<wchar_t>(1));
--- 303,313 ----
_M_init_facet(new (&num_put_w) num_put<wchar_t>(1));
_M_init_facet(new (&collate_w) std::collate<wchar_t>(1));
! typedef __moneypunct_cache<wchar_t, false> money_cache_wf;
! typedef __moneypunct_cache<wchar_t, true> money_cache_wt;
! money_cache_wf* __mpwf = new (&moneypunct_cache_wf) money_cache_wf(2);
_M_init_facet(new (&moneypunct_wf) moneypunct<wchar_t, false>(__mpwf, 1));
! money_cache_wt* __mpwt = new (&moneypunct_cache_wt) money_cache_wt(2);
_M_init_facet(new (&moneypunct_wt) moneypunct<wchar_t, true>(__mpwt, 1));
_M_init_facet(new (&money_get_w) money_get<wchar_t>(1));
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/1.cc libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/1.cc Sun Oct 26 11:33:30 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc Thu Feb 19 18:25:58 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,35 ****
void test01()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
--- 28,33 ----
*************** void test01()
*** 39,48 ****
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- // cache the moneypunct facets
- typedef moneypunct<char, true> __money_true;
- typedef moneypunct<char, false> __money_false;
-
// sanity check the data is correct.
const string empty;
--- 37,42 ----
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/2.cc libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/2.cc Tue Sep 23 22:02:29 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc Thu Feb 19 18:25:40 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,35 ****
void test02()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
--- 28,33 ----
*************** void test02()
*** 37,52 ****
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
! locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
! locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
! VERIFY( loc_c != loc_de );
! VERIFY( loc_hk != loc_fr );
! VERIFY( loc_hk != loc_de );
! VERIFY( loc_de != loc_fr );
!
! // cache the moneypunct facets
! typedef moneypunct<char, true> __money_true;
! typedef moneypunct<char, false> __money_false;
// sanity check the data is correct.
const string empty;
--- 35,41 ----
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
! VERIFY( loc_c != loc_hk );
// sanity check the data is correct.
const string empty;
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/3.cc libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/char/3.cc Tue Sep 23 22:02:29 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc Thu Feb 19 18:26:17 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,52 ****
void test03()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true;
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
-
- // cache the moneypunct facets
- typedef moneypunct<char, true> __money_true;
- typedef moneypunct<char, false> __money_false;
// sanity check the data is correct.
const string empty;
--- 28,41 ----
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/1.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/1.cc Sun Oct 26 11:33:30 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc Thu Feb 19 18:26:57 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,35 ****
void test01()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
--- 28,33 ----
*************** void test01()
*** 39,48 ****
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- // cache the moneypunct facets
- typedef moneypunct<wchar_t, true> __money_true;
- typedef moneypunct<wchar_t, false> __money_false;
-
// sanity check the data is correct.
const wstring empty;
--- 37,42 ----
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/2.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/2.cc Tue Sep 23 22:02:29 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc Thu Feb 19 18:27:38 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,35 ****
void test02()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
--- 28,33 ----
*************** void test02()
*** 37,52 ****
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
! locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
! locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
! VERIFY( loc_c != loc_de );
! VERIFY( loc_hk != loc_fr );
! VERIFY( loc_hk != loc_de );
! VERIFY( loc_de != loc_fr );
!
! // cache the moneypunct facets
! typedef moneypunct<wchar_t, true> __money_true;
! typedef moneypunct<wchar_t, false> __money_false;
// sanity check the data is correct.
const wstring empty;
--- 35,41 ----
// basic construction
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
! VERIFY( loc_c != loc_hk );
// sanity check the data is correct.
const wstring empty;
diff -prN libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/3.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc
*** libstdc++-v3-orig/testsuite/22_locale/money_put/put/wchar_t/3.cc Tue Sep 23 22:02:29 2003
--- libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc Thu Feb 19 18:28:10 2004
***************
*** 1,6 ****
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003 Free Software Foundation
//
// 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
--- 1,6 ----
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
! // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
//
// 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
***************
*** 28,52 ****
void test03()
{
using namespace std;
- typedef money_base::part part;
- typedef money_base::pattern pattern;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
// basic construction
locale loc_c = locale::classic();
- locale loc_hk = __gnu_test::try_named_locale("en_HK");
- locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
- VERIFY( loc_hk != loc_fr );
- VERIFY( loc_hk != loc_de );
- VERIFY( loc_de != loc_fr );
-
- // cache the moneypunct facets
- typedef moneypunct<wchar_t, true> __money_true;
- typedef moneypunct<wchar_t, false> __money_false;
// sanity check the data is correct.
const wstring empty;
--- 28,41 ----