summaryrefslogtreecommitdiff
path: root/gold/gold.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2012-07-10 14:54:29 +0000
committerIan Lance Taylor <ian@airs.com>2012-07-10 14:54:29 +0000
commit81c82a68dc3bb09bd3b5b4101ed9737814023f1a (patch)
tree31f433029323c903f3cb215064e5f10ed627dc2b /gold/gold.h
parent686f09d02169f2e74f4465ed61f5be6f6664749b (diff)
PR gold/14309
* configure.ac: Test whether std::tr1::hash<off_t> works. * gold.h: Add a specialization for std::tr1::hash<off_t> if needed. * output.h (class Output_fill): Add virtual destructor. * configure, config.in: Rebuild.
Diffstat (limited to 'gold/gold.h')
-rw-r--r--gold/gold.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gold/gold.h b/gold/gold.h
index 4258d5543d..9aa7cf3506 100644
--- a/gold/gold.h
+++ b/gold/gold.h
@@ -80,6 +80,22 @@
#define reserve_unordered_map(map, n) ((map)->rehash(n))
+#ifndef HAVE_TR1_HASH_OFF_T
+// The library does not support hashes of off_t values. Add support
+// here. This is likely to be specific to libstdc++. This issue
+// arises with GCC 4.1.x when compiling in 32-bit mode with a 64-bit
+// off_t type.
+namespace std { namespace tr1 {
+template<>
+struct hash<off_t> : public std::unary_function<off_t, std::size_t>
+{
+ std::size_t
+ operator()(off_t val) const
+ { return static_cast<std::size_t>(val); }
+};
+} } // Close namespaces.
+#endif // !defined(HAVE_TR1_HASH_OFF_T)
+
#elif defined(HAVE_EXT_HASH_MAP) && defined(HAVE_EXT_HASH_SET)
#include <ext/hash_map>