Revert __use_cache relocation
Jerry Quinn
jlquinn@optonline.net
Tue Jul 1 05:38:00 GMT 2003
This patch http://gcc.gnu.org/ml/libstdc++/2003-06/msg00368.html is
causing the instantiation problems I'm getting in
http://gcc.gnu.org/ml/libstdc++/2003-07/msg00003.html
Reverting this patch until we can figure out how to solve this.
Jerry
2003-06-30 Jerry Quinn <jlquinn@optonline.net>
* src/locale.cc (__use_cache<numpunct>): Revert previous relocation.
* include/bits/locale_facets.tcc (__use_cache<numpunct>): Ditto.
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.102
diff -u -r1.102 locale_facets.tcc
--- include/bits/locale_facets.tcc 1 Jul 2003 02:53:55 -0000 1.102
+++ include/bits/locale_facets.tcc 1 Jul 2003 05:33:54 -0000
@@ -93,35 +93,13 @@
__use_cache(const locale& __loc);
template<>
- inline const __numpunct_cache<char>&
- __use_cache(const locale& __loc)
- {
- size_t __i = numpunct<char>::id._M_id();
- const locale::facet** __caches = __loc._M_impl->_M_caches;
- if (!__caches[__i])
- {
- __numpunct_cache<char>* __tmp = new __numpunct_cache<char>;
- __tmp->_M_cache(__loc);
- __loc._M_impl->_M_install_cache(__tmp, __i);
- }
- return static_cast<const __numpunct_cache<char>&>(*__caches[__i]);
- }
+ const __numpunct_cache<char>&
+ __use_cache(const locale& __loc);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
- inline const __numpunct_cache<wchar_t>&
- __use_cache(const locale& __loc)
- {
- size_t __i = numpunct<wchar_t>::id._M_id();
- const locale::facet** __caches = __loc._M_impl->_M_caches;
- if (!__caches[__i])
- {
- __numpunct_cache<wchar_t>* __tmp = new __numpunct_cache<wchar_t>;
- __tmp->_M_cache(__loc);
- __loc._M_impl->_M_install_cache(__tmp, __i);
- }
- return static_cast<const __numpunct_cache<wchar_t>&>(*__caches[__i]);
- }
+ const __numpunct_cache<wchar_t>&
+ __use_cache(const locale& __loc);
#endif
// Stage 1: Determine a conversion specifier.
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale.cc,v
retrieving revision 1.84
diff -u -r1.84 locale.cc
--- src/locale.cc 1 Jul 2003 02:53:55 -0000 1.84
+++ src/locale.cc 1 Jul 2003 05:33:54 -0000
@@ -449,6 +449,38 @@
locale::facet::
~facet() { }
+ template<>
+ const __numpunct_cache<char>&
+ __use_cache(const locale& __loc)
+ {
+ size_t __i = numpunct<char>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<char>* __tmp = new __numpunct_cache<char>;
+ __tmp->_M_cache(__loc);
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<char>&>(*__caches[__i]);
+ }
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<>
+ const __numpunct_cache<wchar_t>&
+ __use_cache(const locale& __loc)
+ {
+ size_t __i = numpunct<wchar_t>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<wchar_t>* __tmp = new __numpunct_cache<wchar_t>;
+ __tmp->_M_cache(__loc);
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<wchar_t>&>(*__caches[__i]);
+ }
+#endif
+
// Definitions for static const data members of time_base
template<>
const char*
More information about the Libstdc++
mailing list