aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorBrian Jensen <Jensen.J.Brian@gmail.com>2013-10-26 21:48:48 +0200
committerJohn Ehresman <jpe@wingware.com>2013-11-18 22:17:33 +0100
commitfaa44f349170667fb918fc25e51cc5f392bfc6ad (patch)
tree14e82c54efeece7e8a6255b2928aa2928839ea4e /ext
parent0490b3000a29bcf72d83349dcb7a077f6a6c6c44 (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>
Diffstat (limited to 'ext')
-rw-r--r--ext/sparsehash/google/sparsehash/sparseconfig.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/sparsehash/google/sparsehash/sparseconfig.h b/ext/sparsehash/google/sparsehash/sparseconfig.h
index 44a4ddafc..50736398d 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>