diff --git a/src/util.h b/src/util.h index e57651c3a6981d..08fb01e5ac89cf 100644 --- a/src/util.h +++ b/src/util.h @@ -11,7 +11,12 @@ #include #include -#ifdef __APPLE__ +// OSX 10.9 defaults to libc++ which provides a C++11 header. +#if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090 +#define USE_TR1_TYPE_TRAITS +#endif + +#ifdef USE_TR1_TYPE_TRAITS #include // NOLINT(build/c++tr1) #else #include // std::remove_reference @@ -31,7 +36,7 @@ NO_RETURN void Abort(); NO_RETURN void Assert(const char* const (*args)[4]); void DumpBacktrace(FILE* fp); -#ifdef __APPLE__ +#ifdef USE_TR1_TYPE_TRAITS template using remove_reference = std::tr1::remove_reference; #else template using remove_reference = std::remove_reference;