aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-09-26 21:50:25 +0000
committerIan Lance Taylor <iant@google.com>2006-09-26 21:50:25 +0000
commit274e99f9ae3f56ab0364b3d0947b91deeb3528e1 (patch)
tree18a06078f9c3e8de23428680a5e30437497d19b8 /gold/gold.h
parentd288e464ac39ad965115c86ba29c7dc07ed9f5d6 (diff)
downloadfsf-binutils-gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.zip
fsf-binutils-gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.tar.gz
fsf-binutils-gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.tar.bz2
g++ 3.2.2 portability fixes.
Diffstat (limited to 'gold/gold.h')
-rw-r--r--gold/gold.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gold/gold.h b/gold/gold.h
index 20095eb..03737a2 100644
--- a/gold/gold.h
+++ b/gold/gold.h
@@ -39,10 +39,32 @@
#include <ext/hash_map>
#include <ext/hash_set>
+#include <string>
#define Unordered_set __gnu_cxx::hash_set
#define Unordered_map __gnu_cxx::hash_map
+namespace __gnu_cxx
+{
+
+template<>
+struct hash<std::string>
+{
+ size_t
+ operator()(std::string s) const
+ { return __stl_hash_string(s.c_str()); }
+};
+
+template<typename T>
+struct hash<T*>
+{
+ size_t
+ operator()(T* p) const
+ { return reinterpret_cast<size_t>(p); }
+};
+
+}
+
#else
// The fallback is to just use set and map.