Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 63c62cc

Browse filesBrowse files
Ehsan Akhgaricjihrig
authored andcommitted
src: Only use TR1 type_traits on OSX<10.9
Mac OSX 10.9 has switched to using libc++ by default. libc++ provides a C++11 <type_traits> implementation, so we only need to use the TR1 version when targetting OSX 10.8 or 10.7. PR-URL: #7778 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8f51e36 commit 63c62cc
Copy full SHA for 63c62cc

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Open diff view settings
Collapse file

‎src/util.h‎

Copy file name to clipboardExpand all lines: src/util.h
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
#include <stdio.h>
1212
#include <stdlib.h>
1313

14-
#ifdef __APPLE__
14+
// OSX 10.9 defaults to libc++ which provides a C++11 <type_traits> header.
15+
#if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090
16+
#define USE_TR1_TYPE_TRAITS
17+
#endif
18+
19+
#ifdef USE_TR1_TYPE_TRAITS
1520
#include <tr1/type_traits> // NOLINT(build/c++tr1)
1621
#else
1722
#include <type_traits> // std::remove_reference
@@ -31,7 +36,7 @@ NO_RETURN void Abort();
3136
NO_RETURN void Assert(const char* const (*args)[4]);
3237
void DumpBacktrace(FILE* fp);
3338

34-
#ifdef __APPLE__
39+
#ifdef USE_TR1_TYPE_TRAITS
3540
template <typename T> using remove_reference = std::tr1::remove_reference<T>;
3641
#else
3742
template <typename T> using remove_reference = std::remove_reference<T>;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.