summaryrefslogtreecommitdiffstats
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
commitf8e27a7c4629a6487a0047a7bd32bf5f171e4d9b (patch)
treeb46331deb3fcc0ebb7bc241be9d7c7b6f35d3fc6
parentBuild module registry with MSVC stl (diff)
downloadcore-f8e27a7c4629a6487a0047a7bd32bf5f171e4d9b.tar.gz
core-f8e27a7c4629a6487a0047a7bd32bf5f171e4d9b.zip
some std::hash_map/set -> boost::unordered_map/set changes
-rw-r--r--idlc/inc/idlc/idlctypes.hxx4
-rw-r--r--idlc/inc/idlc/options.hxx2
-rw-r--r--registry/source/regimpl.hxx8
-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
9 files changed, 12 insertions, 76 deletions
diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx
index 0849dd85fb28..3b7b1d5e3db5 100644
--- a/idlc/inc/idlc/idlctypes.hxx
+++ b/idlc/inc/idlc/idlctypes.hxx
@@ -30,7 +30,7 @@
#include <stdio.h>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
#include <vector>
#include <set>
@@ -73,7 +73,7 @@ typedef ::std::list< AstUnionLabel* > LabelList;
class AstDeclaration;
-typedef ::std::hash_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
+typedef ::boost::unordered_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
typedef ::std::list< AstDeclaration* > DeclList;
class AstScope;
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index 796552aec671..f319c082cc42 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -31,7 +31,7 @@
#include <idlc/idlctypes.hxx>
-typedef ::std::hash_map< ::rtl::OString,
+typedef ::boost::unordered_map< ::rtl::OString,
::rtl::OString,
HashString,
EqualString > OptionMap;
diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx
index 4ce3a116ce8d..64e0cc8c401f 100644
--- a/registry/source/regimpl.hxx
+++ b/registry/source/regimpl.hxx
@@ -30,7 +30,7 @@
#define _REGIMPL_HXX_
#include <set>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <registry/registry.h>
#include <rtl/ustring.hxx>
@@ -168,11 +168,7 @@ private:
const rtl::OUString& sName,
sal_Int16 nSpace) const;
-#ifdef USE_MSVC_HASH_MAP
- typedef std::hash_map< rtl::OUString, ORegKey* > KeyMap;
-#else
- typedef std::hash_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
-#endif
+ typedef boost::unordered_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
sal_uInt32 m_refCount;
osl::Mutex m_mutex;
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 6d1291d7087a..0bbd0ba35a48 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 ca249508f061..a9aba130d72b 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 1024cc8f23e7..6860b7c55c9a 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 c185a4e04c4e..302de38d281a 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 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;