forked from Juniper/contrail-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtest-1.6.0_patch1.diff
45 lines (42 loc) · 1.57 KB
/
gtest-1.6.0_patch1.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/third_party/gtest-1.6.0/include/gtest/internal/gtest-port.h b/third_party/gtest-1.6.0/include/gtest/internal/gtest-port.h
index 157b47f..5eabc07 100644
--- a/third_party/gtest-1.6.0/include/gtest/internal/gtest-port.h
+++ b/third_party/gtest-1.6.0/include/gtest/internal/gtest-port.h
@@ -244,6 +244,11 @@
# define GTEST_OS_NACL 1
#endif // __CYGWIN__
+#if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
+// Compiling in at least C++11 mode.
+# define GTEST_LANG_CXX11 1
+#endif
+
// Brings in definitions for functions used in the testing::internal::posix
// namespace (read, write, close, chdir, isatty, stat). We do not currently
// use them on Windows Mobile.
@@ -450,6 +455,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
@@ -465,6 +471,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;
+sing ::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