diff options
author | Brian Jensen <Jensen.J.Brian@gmail.com> | 2013-10-26 21:48:48 +0200 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2013-11-18 22:17:33 +0100 |
commit | faa44f349170667fb918fc25e51cc5f392bfc6ad (patch) | |
tree | 14e82c54efeece7e8a6255b2928aa2928839ea4e | |
parent | 0490b3000a29bcf72d83349dcb7a077f6a6c6c44 (diff) |
Fix compilation issue on OS X 10.9
Starting with OS X 10.9 the system toolchain defaults to libc++.
This is a problem with the current sparse hash config as it defaults
to using c++11 functionality under the std::tr1 namespace instead
of std, which fails for libc++ since it does not implement the tr1
namespace. This change allows libc++ based systems to use the correct
namespace.
Change-Id: Ia8dd49fb5fad2915f41e44240e45a7af9d6453a8
Reviewed-by: John Ehresman <jpe@wingware.com>
-rw-r--r-- | ext/sparsehash/google/sparsehash/sparseconfig.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/sparsehash/google/sparsehash/sparseconfig.h b/ext/sparsehash/google/sparsehash/sparseconfig.h index 44a4dda..5073639 100644 --- a/ext/sparsehash/google/sparsehash/sparseconfig.h +++ b/ext/sparsehash/google/sparsehash/sparseconfig.h @@ -13,6 +13,16 @@ #define HASH_NAMESPACE stdext /* The system-provided hash function including the namespace. */ #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare +/* libc++ does not implement the tr1 namespce, instead the + * equivalient functionality is placed in namespace std, + * so use when it targeting such systems (OS X 10.7 onwards) */ +#elif defined(_LIBCPP_VERSION) + /* the location of the header defining hash functions */ + #define HASH_FUN_H <functional> + /* the namespace of the hash<> function */ + #define HASH_NAMESPACE std + /* The system-provided hash function including the namespace. */ + #define SPARSEHASH_HASH HASH_NAMESPACE::hash #else /* the location of the header defining hash functions */ #define HASH_FUN_H <tr1/functional> |