diff options
author | Ian Lance Taylor <ian@airs.com> | 2012-07-10 14:54:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2012-07-10 14:54:29 +0000 |
commit | 9f130c1d77e785b719be25ae9658630f4e80ff7b (patch) | |
tree | 166d4c9104af01aff9d8b167ced2039803cb915e /gold/gold.h | |
parent | 6e9904258942022fdc259efc11add9f263637335 (diff) | |
download | binutils-redhat-9f130c1d77e785b719be25ae9658630f4e80ff7b.tar.gz |
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.h | 16 |
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> |