diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 79fc528b896..930c0d894dd 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2003-06-30 Jerry Quinn + + * src/locale.cc (__use_cache): Revert previous relocation. + * include/bits/locale_facets.tcc (__use_cache): Ditto. + 2003-06-30 Benjamin Kosnik * 27_io/basic_filebuf/seekoff/char/1-in.cc: New. diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 6a3881652d2..aca0e056d67 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -93,35 +93,13 @@ namespace std __use_cache(const locale& __loc); template<> - inline const __numpunct_cache& - __use_cache(const locale& __loc) - { - size_t __i = numpunct::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __numpunct_cache* __tmp = new __numpunct_cache; - __tmp->_M_cache(__loc); - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast&>(*__caches[__i]); - } + const __numpunct_cache& + __use_cache(const locale& __loc); #ifdef _GLIBCPP_USE_WCHAR_T template<> - inline const __numpunct_cache& - __use_cache(const locale& __loc) - { - size_t __i = numpunct::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __numpunct_cache* __tmp = new __numpunct_cache; - __tmp->_M_cache(__loc); - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast&>(*__caches[__i]); - } + const __numpunct_cache& + __use_cache(const locale& __loc); #endif // Stage 1: Determine a conversion specifier. diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 8cb89e56772..7788a58419d 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -449,6 +449,38 @@ namespace std locale::facet:: ~facet() { } + template<> + const __numpunct_cache& + __use_cache(const locale& __loc) + { + size_t __i = numpunct::id._M_id(); + const locale::facet** __caches = __loc._M_impl->_M_caches; + if (!__caches[__i]) + { + __numpunct_cache* __tmp = new __numpunct_cache; + __tmp->_M_cache(__loc); + __loc._M_impl->_M_install_cache(__tmp, __i); + } + return static_cast&>(*__caches[__i]); + } + +#ifdef _GLIBCPP_USE_WCHAR_T + template<> + const __numpunct_cache& + __use_cache(const locale& __loc) + { + size_t __i = numpunct::id._M_id(); + const locale::facet** __caches = __loc._M_impl->_M_caches; + if (!__caches[__i]) + { + __numpunct_cache* __tmp = new __numpunct_cache; + __tmp->_M_cache(__loc); + __loc._M_impl->_M_install_cache(__tmp, __i); + } + return static_cast&>(*__caches[__i]); + } +#endif + // Definitions for static const data members of time_base template<> const char*