X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Fsrc%2Fcompatibility-c%2B%2B0x.cc;h=08a572761f9c2b73fd10db085e6511119201414a;hb=45936f18b2fbb1ca6647f04675fba92967276249;hp=abdc72c0832a86c7cb4dc08aa7d757820c7068b3;hpb=9fd86bdfec9091d8286b817379ca3e46efe98806;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libstdc++-v3/src/compatibility-c++0x.cc b/libstdc++-v3/src/compatibility-c++0x.cc index abdc72c0832..08a572761f9 100644 --- a/libstdc++-v3/src/compatibility-c++0x.cc +++ b/libstdc++-v3/src/compatibility-c++0x.cc @@ -30,7 +30,7 @@ # error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" #endif -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { // gcc-4.4.0 // exported std::lock_error @@ -50,13 +50,35 @@ namespace std // We need these due to the symbols exported since GLIBCXX_3.4.10. // See libstdc++/41662 for details. -#include "hash-string-aux.cc" +#ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL + template<> + size_t + hash::operator()(string __s) const + { return _Hash_impl::hash(__s.data(), __s.length()); } + + template<> + size_t + hash::operator()(const string& __s) const + { return _Hash_impl::hash(__s.data(), __s.length()); } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + size_t + hash::operator()(wstring __s) const + { return _Hash_impl::hash(__s.data(), __s.length() * sizeof(wchar_t)); } + + template<> + size_t + hash::operator()(const wstring& __s) const + { return _Hash_impl::hash(__s.data(), __s.length() * sizeof(wchar_t)); } +#endif +#endif template<> size_t hash::operator()(error_code __e) const - { - const char* __p = reinterpret_cast(&__e); - return _Fnv_hash<>::hash(__p, sizeof(__e)); + { + const size_t __tmp = std::_Hash_impl::hash(__e._M_value); + return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp); } }