diff options
author | Noah Watkins <noahwatkins@gmail.com> | 2013-07-20 18:41:41 -0700 |
---|---|---|
committer | Noah Watkins <noahwatkins@gmail.com> | 2013-09-17 10:23:46 -0700 |
commit | 33fecbbc62a0dadbb07f8c0c2b2323a8209b1ebb (patch) | |
tree | c32b30f31e25542b4f999cc7ac8e05f57f6392fa | |
parent | 99514537caf4704084d33ca151a5293577f58bd9 (diff) | |
download | ceph-33fecbbc62a0dadbb07f8c0c2b2323a8209b1ebb.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 1f9756b22c7..14724a5bf8b 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -97,7 +97,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; |