diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a558c7ae210..8cd5158aca9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2002-10-16 Benjamin Kosnik + + * include/bits/locale_facets.h (__timepunct::__timepunct): Allocate + _M_name_timepunct. + (__timepunct::~__timepunct): Deallocate, remove specialization + declarations. + (messages::messages): Allocate _M_name_messages. + (messages::~messages): Deallocate. + (messages_byname): Same. + * config/locale/gnu/time_members.cc (__timepunct::~__timepunct): + Remove. + * config/locale/generic/time_members.cc (__timepunct::~__timepunct): + Remove. + + * docs/html/install.html: Add es_MX, en_PH to required locales list. + 2002-10-16 Benjamin Kosnik * config/linker-map.gnu: Add exports for codecvt constructors diff --git a/libstdc++-v3/config/locale/generic/time_members.cc b/libstdc++-v3/config/locale/generic/time_members.cc index 7b5a25c8760..fd45645a690 100644 --- a/libstdc++-v3/config/locale/generic/time_members.cc +++ b/libstdc++-v3/config/locale/generic/time_members.cc @@ -38,10 +38,6 @@ namespace std { - template<> - __timepunct::~__timepunct() - { _S_destroy_c_locale(_M_c_locale_timepunct); } - template<> void __timepunct:: @@ -118,10 +114,6 @@ namespace std } #ifdef _GLIBCPP_USE_WCHAR_T - template<> - __timepunct::~__timepunct() - { _S_destroy_c_locale(_M_c_locale_timepunct); } - template<> void __timepunct:: diff --git a/libstdc++-v3/config/locale/gnu/time_members.cc b/libstdc++-v3/config/locale/gnu/time_members.cc index b2b6f23120f..7df10b8ab71 100644 --- a/libstdc++-v3/config/locale/gnu/time_members.cc +++ b/libstdc++-v3/config/locale/gnu/time_members.cc @@ -39,10 +39,6 @@ namespace std { - template<> - __timepunct::~__timepunct() - { _S_destroy_c_locale(_M_c_locale_timepunct); } - template<> void __timepunct:: @@ -188,10 +184,6 @@ namespace std } #ifdef _GLIBCPP_USE_WCHAR_T - template<> - __timepunct::~__timepunct() - { _S_destroy_c_locale(_M_c_locale_timepunct); } - template<> void __timepunct:: diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html index 8d9101ae49d..58439330200 100644 --- a/libstdc++-v3/docs/html/install.html +++ b/libstdc++-v3/docs/html/install.html @@ -109,8 +109,8 @@

If the 'gnu' locale model is being used, the following locales are used and tested in the libstdc++ testsuites: en_HK, en_US, - fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, and - it_IT. Failure to have the underlying "C" library locale + fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, es_MX, en_PH, + and it_IT. Failure to have the underlying "C" library locale information installed will mean that C++ named locales for the above regions will not work: because of this, the libstdc++ testsuite will not pass the named locale tests. If this isn't an diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index 55953c0d5b1..660bad3c11a 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -952,7 +952,7 @@ namespace std protected: __c_locale _M_c_locale_timepunct; - const char* _M_name_timepunct; + char* _M_name_timepunct; const _CharT* _M_date_format; const _CharT* _M_date_era_format; const _CharT* _M_time_format; @@ -1012,13 +1012,21 @@ namespace std public: explicit __timepunct(size_t __refs = 0) - : locale::facet(__refs), _M_name_timepunct("C") - { _M_initialize_timepunct(); } + : locale::facet(__refs) + { + _M_name_timepunct = new char[2]; + strcpy(_M_name_timepunct, "C"); + _M_initialize_timepunct(); + } explicit __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0) - : locale::facet(__refs), _M_name_timepunct(__s) - { _M_initialize_timepunct(__cloc); } + : locale::facet(__refs) + { + _M_name_timepunct = new char[strlen(__s) + 1]; + strcpy(_M_name_timepunct, __s); + _M_initialize_timepunct(__cloc); + } void _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, @@ -1115,7 +1123,11 @@ namespace std protected: virtual - ~__timepunct(); + ~__timepunct() + { + delete [] _M_name_timepunct; + _S_destroy_c_locale(_M_c_locale_timepunct); + } // For use at construction time only. void @@ -1126,9 +1138,6 @@ namespace std locale::id __timepunct<_CharT>::id; // Specializations. - template<> - __timepunct::~__timepunct(); - template<> const char* __timepunct::_S_timezones[14]; @@ -1142,9 +1151,6 @@ namespace std __timepunct::_M_put(char*, size_t, const char*, const tm*) const; #ifdef _GLIBCPP_USE_WCHAR_T - template<> - __timepunct::~__timepunct(); - template<> const wchar_t* __timepunct::_S_timezones[14]; @@ -1624,7 +1630,7 @@ namespace std __c_locale _M_c_locale_messages; #if 1 // Only needed if glibc < 2.3 - const char* _M_name_messages; + char* _M_name_messages; #endif public: @@ -1632,15 +1638,20 @@ namespace std explicit messages(size_t __refs = 0) - : locale::facet(__refs), _M_name_messages("C") - { _M_c_locale_messages = _S_c_locale; } + : locale::facet(__refs) + { + _M_name_messages = new char[2]; + strcpy(_M_name_messages, "C"); + _M_c_locale_messages = _S_c_locale; + } // Non-standard. explicit - messages(__c_locale __cloc, const char* __name, size_t __refs = 0) + messages(__c_locale __cloc, const char* __s, size_t __refs = 0) : locale::facet(__refs) { - _M_name_messages = __name; + _M_name_messages = new char[strlen(__s) + 1]; + strcpy(_M_name_messages, __s); _M_c_locale_messages = _S_clone_c_locale(__cloc); } @@ -1663,7 +1674,10 @@ namespace std protected: virtual ~messages() - { _S_destroy_c_locale(_M_c_locale_messages); } + { + delete [] _M_name_messages; + _S_destroy_c_locale(_M_c_locale_messages); + } virtual catalog do_open(const basic_string&, const locale&) const; @@ -1751,7 +1765,9 @@ namespace std messages_byname(const char* __s, size_t __refs = 0) : messages<_CharT>(__refs) { - _M_name_messages = __s; + delete [] _M_name_messages; + _M_name_messages = new char[strlen(__s) + 1]; + strcpy(_M_name_messages, __s); _S_destroy_c_locale(_M_c_locale_messages); _S_create_c_locale(_M_c_locale_messages, __s); }