diff options
Diffstat (limited to 'sal/inc')
-rw-r--r-- | sal/inc/osl/diagnose.hxx | 13 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx index 585adf2c30bb..de4795a5233c 100644 --- a/sal/inc/osl/diagnose.hxx +++ b/sal/inc/osl/diagnose.hxx @@ -96,8 +96,21 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> { } }; +#ifdef USE_MSVC_HASH_SET +namespace stdext +{ + inline ::std::size_t hash_value( void const* p ) { + ::std::size_t const d = static_cast< ::std::size_t >( + reinterpret_cast< ::std::ptrdiff_t >(p) ); + return d + (d >> 3); + } +} + +typedef ::std::hash_set<void const*> VoidPointerSet; +#else typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*>, ::rtl::Allocator<void const*> > VoidPointerSet; +#endif struct ObjectRegistryData { ObjectRegistryData( ::std::type_info const& rTypeInfo ) diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 6860b7c55c9a..1024cc8f23e7 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -1550,6 +1550,14 @@ inline OString OUStringToOString( const OUString & rUnicode, } /* Namespace */ +namespace stdext +{ + inline size_t hash_value(const rtl::OUString &rString) + { + return rtl::OUStringHash()(rString); + } +} + #endif /* __cplusplus */ #endif /* _RTL_USTRING_HXX */ |