diff options
author | Fridrich Strba <fridrich.strba@bluewin.ch> | 2011-02-03 14:05:04 -0700 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-02-03 22:32:23 +0100 |
commit | f8e27a7c4629a6487a0047a7bd32bf5f171e4d9b (patch) | |
tree | b46331deb3fcc0ebb7bc241be9d7c7b6f35d3fc6 /sal/rtl | |
parent | 712fba7496cf40dd09ec26672c285ed09e55ab53 (diff) |
some std::hash_map/set -> boost::unordered_map/set changes
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/source/bootstrap.cxx | 13 | ||||
-rw-r--r-- | sal/rtl/source/unload.cxx | 32 |
2 files changed, 5 insertions, 40 deletions
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 92c77365b5c6..8f64eca9b7a9 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -50,7 +50,7 @@ #include "macro.hxx" -#include <hash_map> +#include <boost/unordered_map.hpp> #include <list> #define MY_STRING_(x) # x @@ -604,19 +604,10 @@ void Bootstrap_Impl::expandValue( namespace { struct bootstrap_map { - // map<> may be preferred here, but hash_map<> is implemented fully inline, - // thus there is no need to link against the stlport: -#ifdef USE_MSVC_HASH_MAP - typedef std::hash_map< - rtl::OUString, Bootstrap_Impl *, - std::hash_compare<rtl::OUString>, - rtl::Allocator< OUString> > t; -#else - typedef std::hash_map< + typedef boost::unordered_map< rtl::OUString, Bootstrap_Impl *, rtl::OUStringHash, std::equal_to< rtl::OUString >, rtl::Allocator< OUString > > t; -#endif // get and release must only be called properly synchronized via some mutex // (e.g., osl::Mutex::getGlobalMutex()): diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx index 7d64d5fc5f6c..d33de1a4ee66 100644 --- a/sal/rtl/source/unload.cxx +++ b/sal/rtl/source/unload.cxx @@ -32,7 +32,7 @@ #include <rtl/alloc.h> #include <rtl/ustring.hxx> #include <osl/mutex.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include "rtl/allocator.hxx" #include <functional> @@ -157,30 +157,13 @@ struct hashModule } }; -#ifdef USE_MSVC_HASH_MAP -namespace stdext -{ - inline size_t hash_value( const oslModule& rkey) - { - return (size_t)rkey; - } -} - -typedef std::hash_map< - oslModule, - std::pair<sal_uInt32, component_canUnloadFunc>, - std::hash_compare<oslModule>, - rtl::Allocator<oslModule> -> ModuleMap; -#else -typedef std::hash_map< +typedef boost::unordered_map< oslModule, std::pair<sal_uInt32, component_canUnloadFunc>, hashModule, std::equal_to<oslModule>, rtl::Allocator<oslModule> > ModuleMap; -#endif typedef ModuleMap::iterator Mod_IT; @@ -323,22 +306,13 @@ struct hashListener } }; -#ifdef USE_MSVC_HASH_MAP -typedef std::hash_map< - sal_Int32, - std::pair<rtl_unloadingListenerFunc, void*>, - std::hash_compare<sal_Int32>, - rtl::Allocator<sal_Int32> -> ListenerMap; -#else -typedef std::hash_map< +typedef boost::unordered_map< sal_Int32, std::pair<rtl_unloadingListenerFunc, void*>, hashListener, std::equal_to<sal_Int32>, rtl::Allocator<sal_Int32> > ListenerMap; -#endif typedef ListenerMap::iterator Lis_IT; |