aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-12-09 00:54:04 +0000
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-12-09 00:54:04 +0000
commit5145e0fb203071648f4be6b77c68fabf3d92ab8a (patch)
tree2fae4919ff4d2bb3a7d66f19b020a5d6d676f7e6 /include/gtest
parent2051d2ccc782225096c4a10c280051061809ed4e (diff)
downloadgoogletest-5145e0fb203071648f4be6b77c68fabf3d92ab8a.tar.gz
googletest-5145e0fb203071648f4be6b77c68fabf3d92ab8a.tar.bz2
googletest-5145e0fb203071648f4be6b77c68fabf3d92ab8a.zip
Use <tuple> instead of <tr1/tuple> when the compiler is not gcc, to conform with the TR1 spec.
Diffstat (limited to 'include/gtest')
-rw-r--r--include/gtest/gtest-param-test.h3
-rw-r--r--include/gtest/gtest-param-test.h.pump3
-rw-r--r--include/gtest/internal/gtest-param-util-generated.h4
-rw-r--r--include/gtest/internal/gtest-param-util-generated.h.pump4
-rw-r--r--include/gtest/internal/gtest-port.h19
5 files changed, 17 insertions, 16 deletions
diff --git a/include/gtest/gtest-param-test.h b/include/gtest/gtest-param-test.h
index 2f19c3b3..2d63237f 100644
--- a/include/gtest/gtest-param-test.h
+++ b/include/gtest/gtest-param-test.h
@@ -156,9 +156,6 @@ INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-param-util.h>
#include <gtest/internal/gtest-param-util-generated.h>
-#ifdef GTEST_HAS_COMBINE
-#include <tr1/tuple>
-#endif // GTEST_HAS_COMBINE
namespace testing {
diff --git a/include/gtest/gtest-param-test.h.pump b/include/gtest/gtest-param-test.h.pump
index 0c9c3ba4..858e9170 100644
--- a/include/gtest/gtest-param-test.h.pump
+++ b/include/gtest/gtest-param-test.h.pump
@@ -157,9 +157,6 @@ INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-param-util.h>
#include <gtest/internal/gtest-param-util-generated.h>
-#ifdef GTEST_HAS_COMBINE
-#include <tr1/tuple>
-#endif // GTEST_HAS_COMBINE
namespace testing {
diff --git a/include/gtest/internal/gtest-param-util-generated.h b/include/gtest/internal/gtest-param-util-generated.h
index b709517c..17f3f7bf 100644
--- a/include/gtest/internal/gtest-param-util-generated.h
+++ b/include/gtest/internal/gtest-param-util-generated.h
@@ -48,10 +48,6 @@
#ifdef GTEST_HAS_PARAM_TEST
-#ifdef GTEST_HAS_COMBINE
-#include <tr1/tuple>
-#endif // GTEST_HAS_COMBINE
-
#include <gtest/internal/gtest-param-util.h>
namespace testing {
diff --git a/include/gtest/internal/gtest-param-util-generated.h.pump b/include/gtest/internal/gtest-param-util-generated.h.pump
index 922311cb..fe32a8e6 100644
--- a/include/gtest/internal/gtest-param-util-generated.h.pump
+++ b/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -49,10 +49,6 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
#ifdef GTEST_HAS_PARAM_TEST
-#ifdef GTEST_HAS_COMBINE
-#include <tr1/tuple>
-#endif // GTEST_HAS_COMBINE
-
#include <gtest/internal/gtest-param-util.h>
namespace testing {
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index f04d8465..6a1593ef 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -301,10 +301,10 @@
#endif // GTEST_HAS_PTHREAD
-// Determines whether <tr1/tuple> is available. If you have <tr1/tuple>
+// Determines whether tr1/tuple is available. If you have tr1/tuple
// on your platform, define GTEST_HAS_TR1_TUPLE=1 for both the Google
// Test project and your tests. If you would like Google Test to detect
-// <tr1/tuple> on your platform automatically, please open an issue
+// tr1/tuple on your platform automatically, please open an issue
// ticket at http://code.google.com/p/googletest.
#ifndef GTEST_HAS_TR1_TUPLE
// The user didn't tell us, so we need to figure it out.
@@ -317,6 +317,21 @@
#endif // __GNUC__
#endif // GTEST_HAS_TR1_TUPLE
+// To avoid conditional compilation everywhere, we make it
+// gtest-port.h's responsibility to #include the header implementing
+// tr1/tuple.
+#if GTEST_HAS_TR1_TUPLE
+#if defined(__GNUC__)
+// GCC implements tr1/tuple in the <tr1/tuple> header. This does not
+// conform to the TR1 spec, which requires the header to be <tuple>.
+#include <tr1/tuple>
+#else
+// If the compiler is not GCC, we assume the user is using a
+// spec-conforming TR1 implementation.
+#include <tuple>
+#endif // __GNUC__
+#endif // GTEST_HAS_TR1_TUPLE
+
// Determines whether clone(2) is supported.
// Usually it will only be available on Linux, excluding
// Linux on the Itanium architecture.