summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorFridrich Strba <fridrich.strba@bluewin.ch>2011-02-03 14:05:04 -0700
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-02-03 22:32:23 +0100
commit9e7fbf366b72b3dd01af4a4ef0af6d8294a923e0 (patch)
tree40818781e1d3f0ce258fb2ab150c07a05bf4efc6 /sal
parent80194d6b139472df2bc49ac77f4c9f3aa21a516d (diff)
some std::hash_map/set -> boost::unordered_map/set changes
Diffstat (limited to 'sal')
-rw-r--r--sal/cppunittester/cppunittester.cxx2
-rw-r--r--sal/inc/osl/diagnose.hxx18
-rw-r--r--sal/inc/rtl/ustring.hxx8
-rw-r--r--sal/osl/all/debugbase.cxx1
-rw-r--r--sal/rtl/source/bootstrap.cxx13
-rw-r--r--sal/rtl/source/unload.cxx32
6 files changed, 7 insertions, 67 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 6d1291d70..0bbd0ba35 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -32,7 +32,6 @@
#include <cstdlib>
#include <iostream>
-#include "preextstl.h"
#include "cppunit/CompilerOutputter.h"
#include "cppunit/TestResult.h"
#include "cppunit/TestResultCollector.h"
@@ -40,7 +39,6 @@
#include "cppunit/extensions/TestFactoryRegistry.h"
#include "cppunit/plugin/PlugInManager.h"
#include "cppunit/portability/Stream.h"
-#include "postextstl.h"
#include "osl/thread.h"
#include "rtl/process.h"
#include "rtl/string.hxx"
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 8904e75a2..211eb502f 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -43,7 +43,7 @@
#if ! defined(_RTL_INSTANCE_HXX_)
#include "rtl/instance.hxx"
#endif
-#include <hash_set>
+#include <boost/unordered_set.hpp>
#include <functional>
#include <typeinfo>
@@ -96,22 +96,8 @@ 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*, ::std::hash_compare<void const *>,
+typedef ::boost::unordered_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
::rtl::Allocator<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 cbb278bee..b4b8f4c64 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1550,14 +1550,6 @@ 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 */
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 44c9a76c9..126932447 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -36,7 +36,6 @@
#include "osl/diagnose.hxx"
#include "boost/bind.hpp"
#include <vector>
-#include <algorithm>
// define own ones, independent of OSL_DEBUG_LEVEL:
#define DEBUGBASE_ENSURE_(c, f, l, m) \
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 8bb7edfc3..79398dd15 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 883f3bf5c..6bc024a62 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;