aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-11 03:33:05 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-11 03:33:05 +0000
commit683f431d830dea27069e7eef11d355bae2b82b72 (patch)
tree002f2a1b5dd8ca41ff71134b966ed80cbfec5eee /include/gtest
parentb24b49d85a741f254cbe42da36e0cb93f0b0b57f (diff)
downloadgoogletest-683f431d830dea27069e7eef11d355bae2b82b72.tar.gz
googletest-683f431d830dea27069e7eef11d355bae2b82b72.tar.bz2
googletest-683f431d830dea27069e7eef11d355bae2b82b72.zip
Works around a gcc bug when compiling tr1/tuple with RTTI disabled.
Diffstat (limited to 'include/gtest')
-rw-r--r--include/gtest/internal/gtest-port.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 1b573e4c..e6b9d145 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -379,7 +379,21 @@
#elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
// not conform to the TR1 spec, which requires the header to be <tuple>.
+
+#if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
+// which is #included by <tr1/tuple>, to not compile when RTTI is
+// disabled. _TR1_FUNCTIONAL is the header guard for
+// <tr1/functional>. Hence the following #define is a hack to prevent
+// <tr1/functional> from being included.
+#define _TR1_FUNCTIONAL 1
+#include <tr1/tuple>
+#undef _TR1_FUNCTIONAL // Allows the user to #include
+ // <tr1/functional> if he chooses to.
+#else
#include <tr1/tuple>
+#endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+
#else
// If the compiler is not GCC 4.0+, we assume the user is using a
// spec-conforming TR1 implementation.