Bug 807492 Part 3 - Backport chunk of upstream gtest r629 to fix <tuple> detection on BSDs with old libstdc++, not breaking it on MacOSX r=upstream
authorLandry Breuil <landry@openbsd.org>
Thu, 13 Jun 2013 08:41:49 +0200
changeset 146415 502d77755cf0ebba1d1e3becdb532d4e97f48df4
parent 146414 9387dd4af2e2c692f4d8b25c8d3d55403f929f83
child 146416 1a1a7cab4e24bfa9b0d7478337d68e4ddb0ca52a
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersupstream
bugs807492
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 807492 Part 3 - Backport chunk of upstream gtest r629 to fix <tuple> detection on BSDs with old libstdc++, not breaking it on MacOSX r=upstream
media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h
--- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h
+++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h
@@ -485,20 +485,20 @@
 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
 // and it can be used with some compilers that define __GNUC__.
 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
 # endif
 
-// C++11 specifies that <tuple> provides std::tuple. Users can't use
-// gtest in C++11 mode until their standard library is at least that
-// compliant.
-# if GTEST_LANG_CXX11
+// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
+// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
+// can build with clang but need to use gcc4.2's libstdc++).
+# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
 # endif
 
 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
 #  define GTEST_USE_OWN_TR1_TUPLE 0
 # else
 #  define GTEST_USE_OWN_TR1_TUPLE 1
 # endif