aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2002-10-17 01:19:59 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2002-10-17 01:19:59 +0000
commit2982f6ffc47493a6560ad8cf290c8315be5b24e2 (patch)
tree0482b8efaca3c6f8f1b31c28f63b2cea5f2e3150
parent2303a07914bc82ca17706fc15166bf40b940bfa7 (diff)
downloadgcc-2982f6ffc47493a6560ad8cf290c8315be5b24e2.zip
gcc-2982f6ffc47493a6560ad8cf290c8315be5b24e2.tar.gz
gcc-2982f6ffc47493a6560ad8cf290c8315be5b24e2.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog16
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.cc8
-rw-r--r--libstdc++-v3/config/locale/gnu/time_members.cc8
-rw-r--r--libstdc++-v3/docs/html/install.html4
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h54
5 files changed, 53 insertions, 37 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a558c7a..8cd5158 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,21 @@
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>
+
* config/linker-map.gnu: Add exports for codecvt constructors
where size_t == unsigned long.
diff --git a/libstdc++-v3/config/locale/generic/time_members.cc b/libstdc++-v3/config/locale/generic/time_members.cc
index 7b5a25c..fd45645 100644
--- a/libstdc++-v3/config/locale/generic/time_members.cc
+++ b/libstdc++-v3/config/locale/generic/time_members.cc
@@ -39,10 +39,6 @@
namespace std
{
template<>
- __timepunct<char>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
- template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
@@ -119,10 +115,6 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
- __timepunct<wchar_t>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
- template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
diff --git a/libstdc++-v3/config/locale/gnu/time_members.cc b/libstdc++-v3/config/locale/gnu/time_members.cc
index b2b6f23..7df10b8 100644
--- a/libstdc++-v3/config/locale/gnu/time_members.cc
+++ b/libstdc++-v3/config/locale/gnu/time_members.cc
@@ -40,10 +40,6 @@
namespace std
{
template<>
- __timepunct<char>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
- template<>
void
__timepunct<char>::
_M_put(char* __s, size_t __maxlen, const char* __format,
@@ -189,10 +185,6 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
- __timepunct<wchar_t>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
- template<>
void
__timepunct<wchar_t>::
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html
index 8d9101a..5843933 100644
--- a/libstdc++-v3/docs/html/install.html
+++ b/libstdc++-v3/docs/html/install.html
@@ -109,8 +109,8 @@
<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
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 55953c0..660bad3 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<char>::~__timepunct();
-
template<>
const char*
__timepunct<char>::_S_timezones[14];
@@ -1142,9 +1151,6 @@ namespace std
__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];
@@ -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<char>&, 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);
}