diff -ur ./src_orig/mongo/platform/unordered_map.h ./src/mongo/platform/unordered_map.h --- ./src_orig/mongo/platform/unordered_map.h 2013-10-17 21:37:56.000000000 +0300 +++ ./src/mongo/platform/unordered_map.h 2013-10-26 17:09:11.000000000 +0300 @@ -15,10 +15,13 @@ #pragma once +// Need for _LIBCPP_VERSION +#include + // NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1, // so we can't reliably detect C++11 support by exclusively checking // the value of __cplusplus. -#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_LIBCPP_VERSION) #include diff -ur ./src_orig/mongo/platform/unordered_set.h ./src/mongo/platform/unordered_set.h --- ./src_orig/mongo/platform/unordered_set.h 2013-10-17 21:37:56.000000000 +0300 +++ ./src/mongo/platform/unordered_set.h 2013-10-26 17:05:52.000000000 +0300 @@ -15,10 +15,13 @@ #pragma once +// Need for _LIBCPP_VERSION +#include + // NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1, // so we can't reliably detect C++11 support by exclusively checking // the value of __cplusplus. -#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_LIBCPP_VERSION) #include diff -ur ./src_orig/third_party/s2/hash.h ./src/third_party/s2/hash.h --- ./src_orig/third_party/s2/hash.h 2013-10-17 21:37:56.000000000 +0300 +++ ./src/third_party/s2/hash.h 2013-10-26 15:49:54.000000000 +0300 @@ -7,12 +7,12 @@ #include "mongo/platform/unordered_set.h" #define hash_set mongo::unordered_set -#if defined OS_LINUX || defined OS_MACOSX || defined __sunos__ || defined __freebsd__ -#define HASH_NAMESPACE_START namespace std { namespace tr1 { -#define HASH_NAMESPACE_END }} -#elif defined OS_WINDOWS +#if (defined(OS_MACOSX) && defined(_LIBCPP_VERSION)) || defined(OS_WINDOWS) #define HASH_NAMESPACE_START namespace std { #define HASH_NAMESPACE_END } +#elif defined OS_LINUX || defined OS_MACOSX || defined __sunos__ || defined __freebsd__ +#define HASH_NAMESPACE_START namespace std { namespace tr1 { +#define HASH_NAMESPACE_END }} #endif // Places that hash-related functions are defined: diff -ur ./src_orig/mongo/db/fts/stemmer.cpp ./src/mongo/db/fts/stemmer.cpp --- ./src_orig/mongo/db/fts/stemmer.cpp 2013-10-17 21:37:56.000000000 +0300 +++ ./src/mongo/db/fts/stemmer.cpp 2013-10-26 16:20:59.000000000 +0300 @@ -17,6 +17,7 @@ */ #include +#include #include "mongo/db/fts/stemmer.h" diff -ur ./src_orig/mongo/dbtests/documentsourcetests.cpp ./src/mongo/dbtests/documentsourcetests.cpp --- ./src_orig/mongo/dbtests/documentsourcetests.cpp 2013-10-17 21:37:56.000000000 +0300 +++ ./src/mongo/dbtests/documentsourcetests.cpp 2013-10-26 17:12:06.000000000 +0300 @@ -583,7 +583,7 @@ }; struct ValueCmp { - bool operator()(const Value& a, const Value& b) { + bool operator()(const Value& a, const Value& b) const { return Value::compare( a, b ) < 0; } };