<p>
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
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;
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,
protected:
virtual
- ~__timepunct();
+ ~__timepunct()
+ {
+ delete [] _M_name_timepunct;
+ _S_destroy_c_locale(_M_c_locale_timepunct);
+ }
// For use at construction time only.
void
locale::id __timepunct<_CharT>::id;
// Specializations.
- template<>
- __timepunct<char>::~__timepunct();
-
template<>
const char*
__timepunct<char>::_S_timezones[14];
__timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
#ifdef _GLIBCPP_USE_WCHAR_T
- template<>
- __timepunct<wchar_t>::~__timepunct();
-
template<>
const wchar_t*
__timepunct<wchar_t>::_S_timezones[14];
__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:
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);
}
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<char>&, const locale&) const;
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);
}