summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-11 20:06:06 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-11 20:06:06 +0000
commit16b967aa9c80cf8606c65d375865b77a6bcad255 (patch)
tree7b91b8f3b3590d4aa2e5fce74ffbe998171ff6bf
parent6b4534fdee030348d58e932a4c701a9230d6fdc3 (diff)
downloadgoogletest-16b967aa9c80cf8606c65d375865b77a6bcad255.tar.gz
Fixes the logic for determining whether cxxabi.h is available.
git-svn-id: http://googletest.googlecode.com/svn/trunk@266 861a406c-534a-0410-8894-cb66d6ee9925
-rw-r--r--include/gtest/internal/gtest-type-util.h10
-rw-r--r--include/gtest/internal/gtest-type-util.h.pump10
2 files changed, 12 insertions, 8 deletions
diff --git a/include/gtest/internal/gtest-type-util.h b/include/gtest/internal/gtest-type-util.h
index 1ea7d18..f1b1bed 100644
--- a/include/gtest/internal/gtest-type-util.h
+++ b/include/gtest/internal/gtest-type-util.h
@@ -47,9 +47,11 @@
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-#ifdef __GNUC__
+// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+#ifdef __GLIBCXX__
#include <cxxabi.h>
-#endif // __GNUC__
+#endif // __GLIBCXX__
#include <typeinfo>
@@ -74,7 +76,7 @@ String GetTypeName() {
#if GTEST_HAS_RTTI
const char* const name = typeid(T).name();
-#ifdef __GNUC__
+#ifdef __GLIBCXX__
int status = 0;
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
@@ -84,7 +86,7 @@ String GetTypeName() {
return name_str;
#else
return name;
-#endif // __GNUC__
+#endif // __GLIBCXX__
#else
return "<type>";
diff --git a/include/gtest/internal/gtest-type-util.h.pump b/include/gtest/internal/gtest-type-util.h.pump
index 27821ac..3eb5dce 100644
--- a/include/gtest/internal/gtest-type-util.h.pump
+++ b/include/gtest/internal/gtest-type-util.h.pump
@@ -47,9 +47,11 @@ $var n = 50 $$ Maximum length of type lists we want to support.
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-#ifdef __GNUC__
+// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+#ifdef __GLIBCXX__
#include <cxxabi.h>
-#endif // __GNUC__
+#endif // __GLIBCXX__
#include <typeinfo>
@@ -74,7 +76,7 @@ String GetTypeName() {
#if GTEST_HAS_RTTI
const char* const name = typeid(T).name();
-#ifdef __GNUC__
+#ifdef __GLIBCXX__
int status = 0;
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
@@ -84,7 +86,7 @@ String GetTypeName() {
return name_str;
#else
return name;
-#endif // __GNUC__
+#endif // __GLIBCXX__
#else
return "<type>";