* configure.host (darwin*): Set os_include_dir to a separate directory
for Darwin.
* acinclude.m4 (GLIBCXX_ENABLE_CLOCALE): Add a new C locale kind,
'darwin'.
* config/locale/darwin/ctype_members.cc: New.
* config/os/bsd/darwin/ctype_base.h: New.
* config/os/bsd/darwin/ctype_inline.h: New.
* config/os/bsd/darwin/ctype_noninline.h: New.
* config/os/bsd/darwin/os_defines.h: New.
From-SVN: r89874
2004-10-10 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/monetary_members.cc (_S_construct_pattern):
Give __ret a default value, thus avoiding spurious warnings.
* testsuite/performance/27_io/filebuf_sgetn_unbuf.cc: Open either
words or linux.words, otherwise exit.
* testsuite/performance/27_io/ifstream_getline.cc: Slighlty tweak.
From-SVN: r88848
* config/locale/generic/c_locale.cc (__convert_to_v): Use
_GLIBCXX_HAVE_STRTOF instead _GLIBCXX_USE_C99 to check for strtof.
Likewise, use _GLIBCXX_HAVE_STRTOLD instead of _GLIBCXX_USE_C99
to check for presence of strtold.
From-SVN: r88472
* config/locale/generic/ctype_members.cc
(ctype<wchar_t>::_M_convert_to_wmask): Default case must not use 0 as
initializer for return value, as that is invalid for enumerated types.
* config/locale/gnu/ctype_members.cc
(ctype<wchar_t>::_M_convert_to_wmask): Likewise.
From-SVN: r85862
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Clean up
assignments of _M_decimal_point and _M_thousands_sep.
From-SVN: r83767
* config/locale/gnu/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): Clean up
assignments of _M_decimal_point and _M_thousands_sep.
* config/locale/gnu/time_members.cc
(__timepunct<wchar_t>::_M_initialize_timepunct): Clean up
and reformat assignments of date and time fields.
From-SVN: r83346
2004-04-16 Paolo Carlini <pcarlini@suse.de>
* acconfig.h: Remove _GLIBCXX_USE_LONG_DOUBLE entry, not
used anymore.
* config.h.in: Regenerate.
2004-04-16 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Avoid calling
btowc unnecessarily, just cast to wchar_t (the concerned chars
all belong to the basic character set).
* config/locale/generic/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Likewise.
* config/locale/gnu/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.
From-SVN: r80746
* config/locale/gnu/numeric_members.cc
(numpunct<wchar_t>::_M_initialize_numpunct): No need to wrap
in __uselocale, since btowc is called for chars belonging to
the basic character set.
From-SVN: r80618
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Prefer
_NL_MONETARY_DECIMAL_POINT_WC, _NL_MONETARY_THOUSANDS_SEP_WC,
and __MON_GROUPING to _NL_NUMERIC_DECIMAL_POINT_WC,
_NL_NUMERIC_THOUSANDS_SEP_WC, and GROUPING.
* config/locale/gnu/numeric_members.cc
(numpunct<char>::_M_initialize_numpunct): Prefer DECIMAL_POINT
and THOUSANDS_SEP to the deprecated RADIXCHAR and THOUSEP.
From-SVN: r80477
2004-03-31 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc (__convert_to_v(long double&)):
In v3 uses of sscanf, the special floating-point numbers INF,
INFINITY, etc., cannot occur in input, therefore, if the latter
is too large, ERANGE is always stored in errno, no need of finitel.
From-SVN: r80247
2004-02-02 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/c++locale_internal.h: Remove prototypes
of no longer used GLIBC thread locale functions.
From-SVN: r77140
2004-01-29 Stephen M. Webb <stephen.webb@bregmasoft.com>
* config/local/generic/c_locale.h: Change ::malloc() to new char[].
* config/local/gnu/c_locale.h: Change ::malloc() to new char[].
* include/bits/stl_tempbuf.h: Convert _Temporary_buffer to use
std::get_temporary_buffer() instead of duplicating its code.
Update to C++STYLE conventions.
* include/std/std_memory.h (get_temporary_buffer): Use ::operator
new() instead of std::malloc().
(return_temporary_buffer): Use ::operator delete() instead of
std::free().
From-SVN: r76922
2004-01-12 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.h (struct __numpunct_cache):
Add members _M_truename_len and _M_falsename_len, caching
the lengths of _M_truename and _M_falsename.
(__numpunct_cache<>::_M_cache): Assign the latter.
* include/bits/locale_facets.tcc (num_get::do_get(bool&),
num_put::do_put(bool)): Use the new members, thus avoiding
computing string lengths again and again.
* config/locale/generic/numeric_members.cc
(numpunct<>::_M_initialize_numpunct): Assign the new members.
* config/locale/gnu/numeric_members.cc
(numpunct<>::_M_initialize_numpunct): Likewise.
From-SVN: r75735
2004-01-04 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/numeric_members.cc (_M_initialize_numpunct):
Avoid unnecessarily zero terminating _M_atoms_out and _M_atoms_in;
always use double underscored names.
* config/locale/gnu/numeric_members.cc (_M_initialize_numpunct):
Likewise.
* include/bits/locale_facets.h (struct __numpunct_cache):
Dimension _M_atoms_out and _M_atoms_in one position smaller.
(__numpunct_cache<>::_M_cache): Don't zero terminate _M_atoms_out
and _M_atoms_in.
From-SVN: r75393
2003-12-16 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/11723
* include/bits/locale_facets.h: Add _M_bit and _M_wmask,
used to speed up the computation of ctype::do_is.
* config/locale/generic/ctype_members.cc
(_M_initialize_ctype): Fill _M_bit and _M_wmask.
(ctype::do_is): Use _M_bit and _M_wmask.
* config/locale/gnu/ctype_members.cc: Likewise.
* testsuite/performance/is_wchar_t.cc: New.
* testsuite/performance/narrow_widen_wchar_t.cc: Tweak
string literal (incorrect citation ;)
* include/bits/locale_facets.h: Minor tweaks, const
correctness, unsigned -> size_t.
From-SVN: r74686
2003-12-15 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get::do_get(bool&)):
Fail as soon as the begins of both truename and falsename
stop to match; always leave __beg one position beyond the
last char successfully matched.
* testsuite/22_locale/num_get/get/char/8.cc: New.
* testsuite/22_locale/num_get/get/wchar_t/8.cc: Likewise.
2003-12-15 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.h (_M_widen): Reserve space
for all the possible widened chars.
* config/locale/generic/ctype_members.cc (_M_initialize_ctype):
Compute at construction time all the possible widened chars.
(do_widen): Tweak, simplify.
* config/locale/gnu/ctype_members.cc: Likewise.
* testsuite/performance/narrow_widen_wchar_t.cc: Add tests
for the array versions.
From-SVN: r74636
2003-12-12 Paolo Carlini <pcarlini@suse.de>
Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/13341
* include/bits/locale_facets.h (ctype<wchar_t>): Declare
_M_initialize_ctype() and _M_narrow_ok, _M_narrow and _M_widen.
* src/ctype.cc (ctype<wchar_t>::ctype(size_t),
ctype<wchar_t>::ctype(__c_locale, size_t)): Use
_M_initialize_ctype to fill _M_narrow and _M_widen.
(ctype_byname<wchar_t>::ctype_byname(const char*, size_t)):
Likewise.
* config/locale/generic/ctype_members.cc (do_narrow, do_widen)
Use _M_narrow and _M_widen when possible, instead of calling
wctob and btowc, respectively.
(_M_initialize_ctype): Define, it fills at construction time
_M_narrow and _M_widen.
* config/locale/gnu/ctype_members.cc: Likewise.
* testsuite/performance/narrow_widen_wchar_t.cc: New.
Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com>
From-SVN: r74580
2003-12-08 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc (__convert_to_v(long&),
__convert_to_v(unsigned long&), __convert_to_v(long long&),
__convert_to_v(unsigned long long&): Remove.
(__convert_to_v(float&), __convert_to_v(double&),
__convert_to_v(long double&)): Remove last unused parameter.
* config/locale/gnu/c_locale.cc: Likewise.
* include/bits/locale_facets.h: Likewise.
(num_get::_M_extract_int): Update declaration.
(class __num_base): Tweak _S_ie and _S_iE according to the
_S_atoms_in changes.
* include/bits/locale_facets.tcc (num_get::_M_extract_int):
Provide directly the final _ValueT, not a string: accumulate
the result checking for overflow at each digit.
(num_get::do_get(bool&), num_get::do_get(long&),
num_get::do_get(unsigned short&), num_get::do_get(unsigned int&),
num_get::do_get(unsigned long&), num_get::do_get(long long&),
num_get::do_get(unsigned long long&), num_get::do_get(void*&)):
Use the new _M_extract_int, simplify.
* src/locale-inst.cc (num_get::_M_extract_int(long&),
num_get::_M_extract_int(unsigned short&),
num_get::_M_extract_int(unsigned int&),
num_get::_M_extract_int(unsigned long&),
num_get::_M_extract_int(long long&),
num_get::_M_extract_int(unsigned long long&): Instantiate.
* src/locale_facets.cc (__num_base::_S_atoms_in): Reorder
the chars in the natural order: abcdefABCDEF.
From-SVN: r74423
* config/locale/gnu/monetary_members.cc
(money_base::_S_construct_pattern): For case 3: and 4:
exchanging 'if (__precedes)' and 'if (__space)' allows
to factor out a few more assignments.
From-SVN: r74168
2003-11-30 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/codecvt_members.cc (codecvt::do_in,
codecvt::do_length): More minor tweaks.
From-SVN: r74069
2003-11-25 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/codecvt_members.cc (codecvt::do_length):
Rewrite, using both mbsnrtowcs and mbrtowc in a loop: the
former is very fast, but stops if encounters a NUL.
(codecvt::do_out): Tweaks.
(codecvt::do_in): Tweaks, improve the code dealing with errors.
* testsuite/performance/wchar_t_length.cc: New.
From-SVN: r73934
2003-11-24 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/codecvt_members.cc (codecvt::do_in):
Rewrite, using both mbsnrtowcs and mbrtowc in a loop: the
former is very fast, but stops if encounters a NUL.
(codecvt::do_out): Tweak.
* testsuite/performance/wchar_t_in.cc: New.
2003-11-24 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.h
(__numpunct_cache<>::_M_cache): Set _M_allocated at the beginning
in order to avoid memory leaks; simplify a bit.
From-SVN: r73893
2003-11-20 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/11602
* config/locale/gnu/codecvt_members.cc (codecvt::do_out):
Rewrite, using both wcsnrtombs and wcrtomb in a loop: the
former is very fast, but stops if encounters a NUL.
* testsuite/performance/wchar_t_out.cc: New, from the PR.
From-SVN: r73769
2003-11-19 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/codecvt_members.cc (do_out): If
we can upper bound the total number of external chars
to something smaller than __to_end - __to, avoid the
temporary buffer, the memcopy and simplify the loop.
* config/locale/generic/codecvt_members.cc (do_out):
Likewise.
From-SVN: r73733
2003-10-16 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/12540
* config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t, true/false>::_M_initialize_moneypunct):
Don't leak memory if new throws.
* src/locale.cc (locale::locale(const char*)): In order not
to leak memory in case new throws, use a basic_string type
for __res too and avoid strdup.
From-SVN: r72553
2003-10-09 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/11844
* config/os/aix/ctype_base.h: Fix 'alnum' and 'graph'
to conform to the requirements of 22.2.1.
* config/os/bsd/freebsd/ctype_base.h: Likewise.
* config/os/djgpp/ctype_base.h: Likewise.
* config/os/generic/ctype_base.h: Likewise.
* config/os/gnu-linux/ctype_base.h: Likewise.
* config/os/hpux/ctype_base.h: Likewise.
* config/os/irix/irix6.5/ctype_base.h: Likewise.
* config/os/solaris/solaris2.6/ctype_base.h: Likewise.
* config/os/solaris/solaris2.7/ctype_base.h: Likewise.
* testsuite/22_locale/ctype/11844.cc: New.
* config/locale/generic/ctype_members.cc (do_is):
Generically, use a bitmasksize of 15 (instead of 10), since
we don't know the numerical encoding of the various categories
in the underlying /usr/include/ctype.h.
From-SVN: r72281