diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-01-29 21:22:21 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-01-29 21:22:21 -0500 |
commit | 8acb7bc48c203dfdc63322298203c50f20a41e0a (patch) | |
tree | 072a3f57786c94075f91fff9af899b8e42099c56 /lib | |
parent | 3ce64352ad37e36f7bfd873e96752df61ff12d74 (diff) |
Cherry-pick fix from gtest to fix compilation with libc++ standard library.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gtest-1.5.0/include/gtest/internal/gtest-port.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/gtest-1.5.0/include/gtest/internal/gtest-port.h b/lib/gtest-1.5.0/include/gtest/internal/gtest-port.h index a2a62be920..3cba76ac70 100644 --- a/lib/gtest-1.5.0/include/gtest/internal/gtest-port.h +++ b/lib/gtest-1.5.0/include/gtest/internal/gtest-port.h @@ -221,6 +221,11 @@ #define GTEST_OS_AIX 1 #endif // __CYGWIN__ +#if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L +// Compiling in at least C++11 mode. +# define GTEST_LANG_CXX11 1 +#endif + #if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_SYMBIAN || \ GTEST_OS_SOLARIS || GTEST_OS_AIX @@ -400,6 +405,7 @@ // implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB // Feature Pack download, which we cannot assume the user has. #if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \ + && !GTEST_OS_QNX && (GTEST_LANG_CXX11 || !defined(_LIBCPP_VERSION)) \ || _MSC_VER >= 1600 #define GTEST_USE_OWN_TR1_TUPLE 0 #else @@ -415,6 +421,20 @@ #if GTEST_USE_OWN_TR1_TUPLE #include <gtest/internal/gtest-tuple.h> +# elif GTEST_LANG_CXX11 +# include <tuple> +// C++11 puts its tuple into the ::std namespace rather than +// ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. +namespace std { +namespace tr1 { +using ::std::get; +using ::std::make_tuple; +using ::std::tuple; +using ::std::tuple_element; +using ::std::tuple_size; +} +} + #elif GTEST_OS_SYMBIAN // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to |