diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2001-12-15 07:05:04 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2001-12-15 07:05:04 +0000 |
commit | def9790d51a51a78a700567bb677225a90bc854e (patch) | |
tree | 8de54c61193922ab77a998c6f31861fa57869582 /libstdc++-v3/include/bits/localefwd.h | |
parent | 88f92c0f3f41595fb8c7d233f5aacb205495bd87 (diff) | |
download | gcc-def9790d51a51a78a700567bb677225a90bc854e.zip gcc-def9790d51a51a78a700567bb677225a90bc854e.tar.gz gcc-def9790d51a51a78a700567bb677225a90bc854e.tar.bz2 |
Clean up initialization and simplfy caching of underlying "C" locale objects.
2001-12-14 Benjamin Kosnik <bkoz@redhat.com>
Clean up initialization and simplfy caching of underlying "C"
locale objects.
* src/localename.cc (locale::_Impl::_Impl(string, size_t):
Unconditionally create __clocale object for all named locales,
including "C" and "POSIX".
* config/locale/c_locale_generic.cc
(locale::facet::_S_create_c_locale): Always set __cloc to zero.
* config/locale/c_locale_gnu.cc: Always delete.
* include/bits/localefwd.h (locale::facet::_S_c_locale): New.
* src/locale.cc (locale::classic()): Initialize
locale::facet::_S_c_locale.
(locale::facet::_S_c_locale): Define.
* include/bits/locale_facets.h: Add ctype_byname<wchar_t> ctor
specialization.
* src/locale.cc: Add definition here.
* config/os/gnu-linux/bits/ctype_inline.h: Tweak.
* config/os/gnu-linux/bits/ctype_noninline.h: Adjust initializations.
* include/bits/locale_facets.h (ctype<char>::_M_c_locale_ctype): Add.
Adjust ctors, dtors.
(ctype<char>::_M_toupper): Remove const&.
(ctype<char>::_M_tolower): Remove const&.
(ctype<char>::_M_ctable): Remove const&.
* include/bits/locale_facets.h (collate): Clean up initialization
of _M_c_locale_collate in ctors and dtors.
* config/locale/collate_members_gnu.cc: Always use extended
functions.
* include/bits/locale_facets.h (messages): Clean up inits in ctor/dtor.
(messages_byname): Same.
* config/locale/messages_members_generic.h (messages::~messages):
Remove.
* config/locale/messages_members_gnu.h: Same.
* include/bits/localefwd.h: Clean. Move dtor definitions to
* src/locale.cc: Here.
* testsuite/22_locale/facet.cc: Fix spelling.
Named locale support for ctype<wchar_t>.
* acinclude.m4 (GLIBCPP_ENABLE_CLOCALE): Add variable
ctype_members_* bits.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* src/Makefile.am (sources): Add ctype.cc.
* src/Makefile.in: Regenerate.
* config/locale/ctype_members_generic.cc: New file.
* config/locale/ctype_members_gnu.cc: New file.
* src/locale.cc: Remove ctype<wchart_t> definitions.
From-SVN: r48034
Diffstat (limited to 'libstdc++-v3/include/bits/localefwd.h')
-rw-r--r-- | libstdc++-v3/include/bits/localefwd.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index af48b60..a0fe324 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -282,7 +282,10 @@ namespace std static inline void _S_initialize() - { if (!_S_classic) classic(); } + { + if (!_S_classic) + classic(); + } static category _S_normalize_category(category); @@ -344,7 +347,7 @@ namespace std _Impl(string __name, size_t); ~_Impl() throw(); - bool + inline bool _M_check_same_name() { bool __ret = true; @@ -352,6 +355,7 @@ namespace std __ret &= _M_names[i] == _M_names[i + 1]; return __ret; } + void _M_replace_categories(const _Impl*, category); @@ -387,11 +391,15 @@ namespace std friend class __enc_traits; protected: + // Contains data from the underlying "C" library for default "C" + // and "POSIX" locales. + static __c_locale _S_c_locale; + explicit facet(size_t __refs = 0) throw(); virtual - ~facet() { }; + ~facet(); static void _S_create_c_locale(__c_locale& __cloc, const char* __s); @@ -447,8 +455,7 @@ namespace std public: // NB: This class is always a static data member, and thus can be // counted on to be zero-initialized. - // XXX id() : _M_index(0) { } - id() { } + id(); }; template<typename _Facet> |