diff options
author | Noah Watkins <noahwatkins@gmail.com> | 2013-07-20 18:41:41 -0700 |
---|---|---|
committer | Noah Watkins <noahwatkins@gmail.com> | 2013-07-21 10:31:21 -0700 |
commit | 3378f1088f25dc3f59cb6d68f879d66de0bef7f3 (patch) | |
tree | 3090be26421cdeb57e56df06b66a3f951d0d8ee6 | |
parent | 24627cf07bb0221571cc03613a8b1853352bb568 (diff) | |
download | ceph-3378f1088f25dc3f59cb6d68f879d66de0bef7f3.tar.gz |
hashing: add missing hash functions
OSX doesn't define hash<int64_t>, hash<uint64_t>, and isn't able to cast
pthread_t to a type with a hash. This fixes the problem by defining
replacements.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
-rw-r--r-- | src/common/lockdep.cc | 2 | ||||
-rw-r--r-- | src/include/types.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 7f34f801d1d..09c7b83e657 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -20,7 +20,7 @@ #include <ext/hash_map> -#if defined(__FreeBSD__) && defined(__LP64__) // On FreeBSD pthread_t is a pointer. +#if (defined(__FreeBSD__) || defined(__APPLE__)) && defined(__LP64__) // On FreeBSD pthread_t is a pointer. namespace __gnu_cxx { template<> struct hash<pthread_t> diff --git a/src/include/types.h b/src/include/types.h index bed00175dd4..788ac4d2a94 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -98,7 +98,7 @@ namespace __gnu_cxx { } }; -#ifndef __LP64__ +#if !defined(__LP64__) || defined(__APPLE__) template<> struct hash<int64_t> { size_t operator()(int64_t __x) const { static hash<int32_t> H; |