This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] fix names members
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Oct 2002 20:17:48 -0500
- Subject: [v3] fix names members
tested x86/linux
tested x86/linux --enable-clocale=generic
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.
Index: config/locale/generic/time_members.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/generic/time_members.cc,v
retrieving revision 1.4
diff -c -p -r1.4 time_members.cc
*** config/locale/generic/time_members.cc 8 Oct 2002 23:32:21 -0000 1.4
--- config/locale/generic/time_members.cc 17 Oct 2002 00:37:29 -0000
***************
*** 39,48 ****
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,
--- 39,44 ----
*************** namespace std
*** 118,127 ****
}
#ifdef _GLIBCPP_USE_WCHAR_T
- template<>
- __timepunct<wchar_t>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
template<>
void
__timepunct<wchar_t>::
--- 114,119 ----
Index: config/locale/gnu/time_members.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/gnu/time_members.cc,v
retrieving revision 1.7
diff -c -p -r1.7 time_members.cc
*** config/locale/gnu/time_members.cc 8 Oct 2002 23:32:22 -0000 1.7
--- config/locale/gnu/time_members.cc 17 Oct 2002 00:37:29 -0000
***************
*** 40,49 ****
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,
--- 40,45 ----
*************** namespace std
*** 188,197 ****
}
#ifdef _GLIBCPP_USE_WCHAR_T
- template<>
- __timepunct<wchar_t>::~__timepunct()
- { _S_destroy_c_locale(_M_c_locale_timepunct); }
-
template<>
void
__timepunct<wchar_t>::
--- 184,189 ----
Index: docs/html/install.html
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/html/install.html,v
retrieving revision 1.20
diff -c -p -r1.20 install.html
*** docs/html/install.html 7 Oct 2002 18:11:18 -0000 1.20
--- docs/html/install.html 17 Oct 2002 00:37:29 -0000
***************
*** 109,116 ****
<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
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
--- 109,116 ----
<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, 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: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.48
diff -c -p -r1.48 locale_facets.h
*** include/bits/locale_facets.h 8 Oct 2002 23:32:22 -0000 1.48
--- include/bits/locale_facets.h 17 Oct 2002 00:37:32 -0000
*************** namespace std
*** 952,958 ****
protected:
__c_locale _M_c_locale_timepunct;
! const char* _M_name_timepunct;
const _CharT* _M_date_format;
const _CharT* _M_date_era_format;
const _CharT* _M_time_format;
--- 952,958 ----
protected:
__c_locale _M_c_locale_timepunct;
! char* _M_name_timepunct;
const _CharT* _M_date_format;
const _CharT* _M_date_era_format;
const _CharT* _M_time_format;
*************** namespace std
*** 1012,1024 ****
public:
explicit
__timepunct(size_t __refs = 0)
! : locale::facet(__refs), _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); }
void
_M_put(_CharT* __s, size_t __maxlen, const _CharT* __format,
--- 1012,1032 ----
public:
explicit
__timepunct(size_t __refs = 0)
! : 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 = 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,
*************** namespace std
*** 1115,1121 ****
protected:
virtual
! ~__timepunct();
// For use at construction time only.
void
--- 1123,1133 ----
protected:
virtual
! ~__timepunct()
! {
! delete [] _M_name_timepunct;
! _S_destroy_c_locale(_M_c_locale_timepunct);
! }
// For use at construction time only.
void
*************** namespace std
*** 1126,1134 ****
locale::id __timepunct<_CharT>::id;
// Specializations.
- template<>
- __timepunct<char>::~__timepunct();
-
template<>
const char*
__timepunct<char>::_S_timezones[14];
--- 1138,1143 ----
*************** namespace std
*** 1142,1150 ****
__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];
--- 1151,1156 ----
*************** namespace std
*** 1624,1630 ****
__c_locale _M_c_locale_messages;
#if 1
// Only needed if glibc < 2.3
! const char* _M_name_messages;
#endif
public:
--- 1630,1636 ----
__c_locale _M_c_locale_messages;
#if 1
// Only needed if glibc < 2.3
! char* _M_name_messages;
#endif
public:
*************** namespace std
*** 1632,1646 ****
explicit
messages(size_t __refs = 0)
! : locale::facet(__refs), _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)
: locale::facet(__refs)
{
! _M_name_messages = __name;
_M_c_locale_messages = _S_clone_c_locale(__cloc);
}
--- 1638,1657 ----
explicit
messages(size_t __refs = 0)
! : 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* __s, size_t __refs = 0)
: locale::facet(__refs)
{
! _M_name_messages = new char[strlen(__s) + 1];
! strcpy(_M_name_messages, __s);
_M_c_locale_messages = _S_clone_c_locale(__cloc);
}
*************** namespace std
*** 1663,1669 ****
protected:
virtual
~messages()
! { _S_destroy_c_locale(_M_c_locale_messages); }
virtual catalog
do_open(const basic_string<char>&, const locale&) const;
--- 1674,1683 ----
protected:
virtual
~messages()
! {
! delete [] _M_name_messages;
! _S_destroy_c_locale(_M_c_locale_messages);
! }
virtual catalog
do_open(const basic_string<char>&, const locale&) const;
*************** namespace std
*** 1751,1757 ****
messages_byname(const char* __s, size_t __refs = 0)
: messages<_CharT>(__refs)
{
! _M_name_messages = __s;
_S_destroy_c_locale(_M_c_locale_messages);
_S_create_c_locale(_M_c_locale_messages, __s);
}
--- 1765,1773 ----
messages_byname(const char* __s, size_t __refs = 0)
: messages<_CharT>(__refs)
{
! 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);
}