diff options
author | Ian Lance Taylor <iant@google.com> | 2006-09-26 21:50:25 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2006-09-26 21:50:25 +0000 |
commit | 274e99f9ae3f56ab0364b3d0947b91deeb3528e1 (patch) | |
tree | 18a06078f9c3e8de23428680a5e30437497d19b8 /gold/gold.h | |
parent | d288e464ac39ad965115c86ba29c7dc07ed9f5d6 (diff) | |
download | gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.zip gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.tar.gz gdb-274e99f9ae3f56ab0364b3d0947b91deeb3528e1.tar.bz2 |
g++ 3.2.2 portability fixes.
Diffstat (limited to 'gold/gold.h')
-rw-r--r-- | gold/gold.h | 22 |
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. |