Skip to content

src: Only use the TR1 type_traits when targeting OSX<10.9 #7778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
#include <stdio.h>
#include <stdlib.h>

#ifdef __APPLE__
// OSX 10.9 defaults to libc++ which provides a C++11 <type_traits> header.
#if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090
#define USE_TR1_TYPE_TRAITS
#endif

#ifdef USE_TR1_TYPE_TRAITS
#include <tr1/type_traits> // NOLINT(build/c++tr1)
#else
#include <type_traits> // std::remove_reference
Expand All @@ -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 <typename T> using remove_reference = std::tr1::remove_reference<T>;
#else
template <typename T> using remove_reference = std::remove_reference<T>;
Expand Down