From 1b9ad1d9aea03385ca67e0d379d0b9d5b8bddff3 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 12 Jan 2015 21:45:50 +0000 Subject: [PATCH] re PR libstdc++/64553 (Missing '# ifdef _GLIBCXX_USE_WCHAR_T' in src/c++11/cxx11-shim_facet.cc) PR libstdc++/64553 * src/c++11/cxx11-shim_facets.cc: Check for wchar_t support. From-SVN: r219496 --- libstdc++-v3/ChangeLog | 3 ++ libstdc++-v3/src/c++11/cxx11-shim_facets.cc | 58 ++++++++++++++------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 55b2a24ea55..ec5a1d53d7f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -4,6 +4,9 @@ * src/c++11/cxx11-shim_facets.cc (locale::facet::_M_sso_shim): Check for RTTI support. + PR libstdc++/64553 + * src/c++11/cxx11-shim_facets.cc: Check for wchar_t support. + 2015-01-10 Thomas Schwinge * doc/xml/manual/parallel_mode.xml: Update for libgomp being diff --git a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc index 56959b6f873..407b7b9f921 100644 --- a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc +++ b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc @@ -87,13 +87,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION union { const void* _M_p; char* _M_pc; +#ifdef _GLIBCXX_USE_WCHAR_T wchar_t* _M_pwc; +#endif }; size_t _M_len; char _M_unused[16]; operator const char*() const { return _M_pc; } +#ifdef _GLIBCXX_USE_WCHAR_T operator const wchar_t*() const { return _M_pwc; } +#endif }; union { __str_rep _M_str; @@ -251,9 +255,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_t _M_grouping_size; }; - template class numpunct_shim; - template class numpunct_shim; - template struct collate_shim : std::collate<_CharT>, facet::__shim { @@ -279,9 +280,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; - template class collate_shim; - template class collate_shim; - template struct time_get_shim : std::time_get<_CharT>, facet::__shim { @@ -363,11 +361,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __cache_type* _M_cache; }; - template class moneypunct_shim; - template class moneypunct_shim; - template class moneypunct_shim; - template class moneypunct_shim; - template struct money_get_shim : std::money_get<_CharT>, facet::__shim { @@ -409,9 +402,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; - template class money_get_shim; - template class money_get_shim; - template struct money_put_shim : std::money_put<_CharT>, facet::__shim { @@ -441,10 +431,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; - template class money_put_shim; - template class money_put_shim; - - template struct messages_shim : std::messages<_CharT>, facet::__shim { @@ -477,8 +463,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; + template class numpunct_shim; + template class collate_shim; + template class moneypunct_shim; + template class moneypunct_shim; + template class money_get_shim; + template class money_put_shim; template class messages_shim; +#ifdef _GLIBCXX_USE_WCHAR_T + template class numpunct_shim; + template class collate_shim; + template class moneypunct_shim; + template class moneypunct_shim; + template class money_get_shim; + template class money_put_shim; template class messages_shim; +#endif template inline size_t @@ -524,9 +524,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __numpunct_fill_cache(current_abi, const facet*, __numpunct_cache*, const char*&, size_t&); +#ifdef _GLIBCXX_USE_WCHAR_T template void __numpunct_fill_cache(current_abi, const facet*, __numpunct_cache*, const char*&, size_t&); +#endif template int @@ -540,9 +542,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __collate_compare(current_abi, const facet*, const char*, const char*, const char*, const char*); +#ifdef _GLIBCXX_USE_WCHAR_T template int __collate_compare(current_abi, const facet*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); +#endif template void @@ -557,9 +561,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __collate_transform(current_abi, const facet*, __any_string&, const char*, const char*); +#ifdef _GLIBCXX_USE_WCHAR_T template void __collate_transform(current_abi, const facet*, __any_string&, const wchar_t*, const wchar_t*); +#endif template void @@ -599,6 +605,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __moneypunct_fill_cache(current_abi, const facet*, __moneypunct_cache*); +#ifdef _GLIBCXX_USE_WCHAR_T template void __moneypunct_fill_cache(current_abi, const facet*, __moneypunct_cache*); @@ -606,6 +613,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template void __moneypunct_fill_cache(current_abi, const facet*, __moneypunct_cache*); +#endif template messages_base::catalog @@ -621,9 +629,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __messages_open(current_abi, const facet*, const char*, size_t, const locale&); +#ifdef _GLIBCXX_USE_WCHAR_T template messages_base::catalog __messages_open(current_abi, const facet*, const char*, size_t, const locale&); +#endif template void @@ -639,9 +649,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __messages_get(current_abi, const facet*, __any_string&, messages_base::catalog, int, int, const char*, size_t); +#ifdef _GLIBCXX_USE_WCHAR_T template void __messages_get(current_abi, const facet*, __any_string&, messages_base::catalog, int, int, const wchar_t*, size_t); +#endif template void @@ -653,9 +665,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template void __messages_close(current_abi, const facet*, messages_base::catalog c); +#ifdef _GLIBCXX_USE_WCHAR_T template void __messages_close(current_abi, const facet*, messages_base::catalog c); +#endif template time_base::dateorder @@ -665,8 +679,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template time_base::dateorder __time_get_dateorder(current_abi, const facet*); +#ifdef _GLIBCXX_USE_WCHAR_T template time_base::dateorder __time_get_dateorder(current_abi, const facet*); +#endif template istreambuf_iterator @@ -697,10 +713,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION istreambuf_iterator, istreambuf_iterator, ios_base&, ios_base::iostate&, tm*, char); +#ifdef _GLIBCXX_USE_WCHAR_T template istreambuf_iterator __time_get(current_abi, const facet*, istreambuf_iterator, istreambuf_iterator, ios_base&, ios_base::iostate&, tm*, char); +#endif template istreambuf_iterator @@ -725,11 +743,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool, ios_base&, ios_base::iostate&, long double*, __any_string*); +#ifdef _GLIBCXX_USE_WCHAR_T template istreambuf_iterator __money_get(current_abi, const facet*, istreambuf_iterator, istreambuf_iterator, bool, ios_base&, ios_base::iostate&, long double*, __any_string*); +#endif template ostreambuf_iterator @@ -748,9 +768,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __money_put(current_abi, const facet*, ostreambuf_iterator, bool, ios_base&, char, long double, const __any_string*); +#ifdef _GLIBCXX_USE_WCHAR_T template ostreambuf_iterator __money_put(current_abi, const facet*, ostreambuf_iterator, bool, ios_base&, wchar_t, long double, const __any_string*); +#endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace __facet_shims -- 2.30.2