locale_facets.h (__timepunct::__timepunct): Allocate _M_name_timepunct.
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 17 Oct 2002 01:19:59 +0000 (01:19 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 17 Oct 2002 01:19:59 +0000 (01:19 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/generic/time_members.cc
libstdc++-v3/config/locale/gnu/time_members.cc
libstdc++-v3/docs/html/install.html
libstdc++-v3/include/bits/locale_facets.h

index a558c7ae210aa6eccacdc29d3ffc52b49592250c..8cd5158aca90a6dbfe14755aa13ccfc2a28b715c 100644 (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>
 
        * config/linker-map.gnu: Add exports for codecvt constructors
index 7b5a25c87609973a82d78eb776a0eef1bc356ad8..fd45645a690cf59d0d63c662c8cfcdf431ee4e03 100644 (file)
 
 namespace std
 {
-  template<>
-    __timepunct<char>::~__timepunct()
-    { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
   template<>
     void
     __timepunct<char>::
@@ -118,10 +114,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>::
index b2b6f23120f9b4de144dc8a8b32a21c4cd09f663..7df10b8ab7162dff7e11eac3e02af203d46a4752 100644 (file)
 
 namespace std
 {
-  template<>
-    __timepunct<char>::~__timepunct()
-    { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
   template<>
     void
     __timepunct<char>::
@@ -188,10 +184,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>::
index 8d9101ae49dae1d02121c862e434b66d6bca5768..58439330200dd00a39266743a1bfb2121aa3f99e 100644 (file)
       <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
index 55953c0d5b1514b69d7cd5829acf5784f76e4f0a..660bad3c11a939459c4290ee4cfc33756c32abc6 100644 (file)
@@ -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); 
       }