locale_facets.h (__timepunct::__timepunct): Allocate _M_name_timepunct.

2002-10-16  Benjamin Kosnik  <bkoz@redhat.com>

	* 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.

From-SVN: r58232
This commit is contained in:
Benjamin Kosnik 2002-10-17 01:19:59 +00:00 committed by Benjamin Kosnik
parent 2303a07914
commit 2982f6ffc4
5 changed files with 53 additions and 37 deletions

View File

@ -1,3 +1,19 @@
2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
* 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 <bkoz@redhat.com> 2002-10-16 Benjamin Kosnik <bkoz@redhat.com>
* config/linker-map.gnu: Add exports for codecvt constructors * config/linker-map.gnu: Add exports for codecvt constructors

View File

@ -38,10 +38,6 @@
namespace std namespace std
{ {
template<>
__timepunct<char>::~__timepunct()
{ _S_destroy_c_locale(_M_c_locale_timepunct); }
template<> template<>
void void
__timepunct<char>:: __timepunct<char>::
@ -118,10 +114,6 @@ namespace std
} }
#ifdef _GLIBCPP_USE_WCHAR_T #ifdef _GLIBCPP_USE_WCHAR_T
template<>
__timepunct<wchar_t>::~__timepunct()
{ _S_destroy_c_locale(_M_c_locale_timepunct); }
template<> template<>
void void
__timepunct<wchar_t>:: __timepunct<wchar_t>::

View File

@ -39,10 +39,6 @@
namespace std namespace std
{ {
template<>
__timepunct<char>::~__timepunct()
{ _S_destroy_c_locale(_M_c_locale_timepunct); }
template<> template<>
void void
__timepunct<char>:: __timepunct<char>::
@ -188,10 +184,6 @@ namespace std
} }
#ifdef _GLIBCPP_USE_WCHAR_T #ifdef _GLIBCPP_USE_WCHAR_T
template<>
__timepunct<wchar_t>::~__timepunct()
{ _S_destroy_c_locale(_M_c_locale_timepunct); }
template<> template<>
void void
__timepunct<wchar_t>:: __timepunct<wchar_t>::

View File

@ -109,8 +109,8 @@
<p> <p>
If the 'gnu' locale model is being used, the following locales If the 'gnu' locale model is being used, the following locales
are used and tested in the libstdc++ testsuites: en_HK, en_US, 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 fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, es_MX, en_PH,
it_IT. Failure to have the underlying "C" library locale and it_IT. Failure to have the underlying "C" library locale
information installed will mean that C++ named locales for the information installed will mean that C++ named locales for the
above regions will not work: because of this, the libstdc++ above regions will not work: because of this, the libstdc++
testsuite will not pass the named locale tests. If this isn't an testsuite will not pass the named locale tests. If this isn't an

View File

@ -952,7 +952,7 @@ namespace std
protected: protected:
__c_locale _M_c_locale_timepunct; __c_locale _M_c_locale_timepunct;
const char* _M_name_timepunct; char* _M_name_timepunct;
const _CharT* _M_date_format; const _CharT* _M_date_format;
const _CharT* _M_date_era_format; const _CharT* _M_date_era_format;
const _CharT* _M_time_format; const _CharT* _M_time_format;
@ -1012,13 +1012,21 @@ namespace std
public: public:
explicit explicit
__timepunct(size_t __refs = 0) __timepunct(size_t __refs = 0)
: locale::facet(__refs), _M_name_timepunct("C") : locale::facet(__refs)
{ _M_initialize_timepunct(); } {
_M_name_timepunct = new char[2];
strcpy(_M_name_timepunct, "C");
_M_initialize_timepunct();
}
explicit explicit
__timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0) __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0)
: locale::facet(__refs), _M_name_timepunct(__s) : locale::facet(__refs)
{ _M_initialize_timepunct(__cloc); } {
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
_M_initialize_timepunct(__cloc);
}
void void
_M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
@ -1115,7 +1123,11 @@ namespace std
protected: protected:
virtual virtual
~__timepunct(); ~__timepunct()
{
delete [] _M_name_timepunct;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
// For use at construction time only. // For use at construction time only.
void void
@ -1126,9 +1138,6 @@ namespace std
locale::id __timepunct<_CharT>::id; locale::id __timepunct<_CharT>::id;
// Specializations. // Specializations.
template<>
__timepunct<char>::~__timepunct();
template<> template<>
const char* const char*
__timepunct<char>::_S_timezones[14]; __timepunct<char>::_S_timezones[14];
@ -1142,9 +1151,6 @@ namespace std
__timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const; __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
#ifdef _GLIBCPP_USE_WCHAR_T #ifdef _GLIBCPP_USE_WCHAR_T
template<>
__timepunct<wchar_t>::~__timepunct();
template<> template<>
const wchar_t* const wchar_t*
__timepunct<wchar_t>::_S_timezones[14]; __timepunct<wchar_t>::_S_timezones[14];
@ -1624,7 +1630,7 @@ namespace std
__c_locale _M_c_locale_messages; __c_locale _M_c_locale_messages;
#if 1 #if 1
// Only needed if glibc < 2.3 // Only needed if glibc < 2.3
const char* _M_name_messages; char* _M_name_messages;
#endif #endif
public: public:
@ -1632,15 +1638,20 @@ namespace std
explicit explicit
messages(size_t __refs = 0) messages(size_t __refs = 0)
: locale::facet(__refs), _M_name_messages("C") : locale::facet(__refs)
{ _M_c_locale_messages = _S_c_locale; } {
_M_name_messages = new char[2];
strcpy(_M_name_messages, "C");
_M_c_locale_messages = _S_c_locale;
}
// Non-standard. // Non-standard.
explicit 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) : 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); _M_c_locale_messages = _S_clone_c_locale(__cloc);
} }
@ -1663,7 +1674,10 @@ namespace std
protected: protected:
virtual virtual
~messages() ~messages()
{ _S_destroy_c_locale(_M_c_locale_messages); } {
delete [] _M_name_messages;
_S_destroy_c_locale(_M_c_locale_messages);
}
virtual catalog virtual catalog
do_open(const basic_string<char>&, const locale&) const; do_open(const basic_string<char>&, const locale&) const;
@ -1751,7 +1765,9 @@ namespace std
messages_byname(const char* __s, size_t __refs = 0) messages_byname(const char* __s, size_t __refs = 0)
: messages<_CharT>(__refs) : 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_destroy_c_locale(_M_c_locale_messages);
_S_create_c_locale(_M_c_locale_messages, __s); _S_create_c_locale(_M_c_locale_messages, __s);
} }