This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] fix duplicate symbol errors in __timepunct
- To: gcc-patches at gcc dot gnu dot org, bryce at waitaki dot otago dot ac dot nz, shebs at apple dot com
- Subject: [v3] fix duplicate symbol errors in __timepunct
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 19 Oct 2001 14:19:57 -0700
Sorry folks. I forgot to declare specializations for _M_put_helper,
thus the duplicate symbols. Fixed with this.
-benjamin
tested x86/linux
2001-10-19 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (__timepunct::_M_put_helper):
Declare specializations for char, wchar_t.
Index: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.23
diff -c -p -r1.23 locale_facets.h
*** locale_facets.h 2001/10/02 18:44:39 1.23
--- locale_facets.h 2001/10/19 09:18:51
*************** namespace std
*** 1250,1259 ****
--- 1250,1284 ----
template<typename _CharT>
locale::id __timepunct<_CharT>::id;
+ // Specializations.
template<>
const char*
__timepunct<char>::_S_timezones[14];
+ template<>
+ void
+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<char>::_M_put_helper(char*, size_t, const char*,
+ const tm*) const;
+
+ #ifdef _GLIBCPP_USE_WCHAR_T
+ template<>
+ const wchar_t*
+ __timepunct<wchar_t>::_S_timezones[14];
+
+ template<>
+ void
+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
+
+ template<>
+ void
+ __timepunct<wchar_t>::_M_put_helper(wchar_t*, size_t, const wchar_t*,
+ const tm*) const;
+ #endif
+
// Generic.
template<typename _CharT>
const _CharT* __timepunct<_CharT>::_S_timezones[14];
*************** namespace std
*** 1270,1289 ****
__timepunct<_CharT>::_M_put_helper(_CharT*, size_t, const _CharT*,
const tm*) const
{ }
-
- template<>
- void
- __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc);
-
- #ifdef _GLIBCPP_USE_WCHAR_T
- template<>
- const wchar_t*
- __timepunct<wchar_t>::_S_timezones[14];
-
- template<>
- void
- __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc);
- #endif
template<typename _CharT, typename _InIter>
class time_get : public locale::facet, public time_base
--- 1295,1300 ----