Fixes the logic for determining whether cxxabi.h is available.
This commit is contained in:
parent
683f431d83
commit
210ea10e7a
@ -47,9 +47,11 @@
|
|||||||
|
|
||||||
#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
|
#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>
|
#include <cxxabi.h>
|
||||||
#endif // __GNUC__
|
#endif // __GLIBCXX__
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
@ -74,7 +76,7 @@ String GetTypeName() {
|
|||||||
#if GTEST_HAS_RTTI
|
#if GTEST_HAS_RTTI
|
||||||
|
|
||||||
const char* const name = typeid(T).name();
|
const char* const name = typeid(T).name();
|
||||||
#ifdef __GNUC__
|
#ifdef __GLIBCXX__
|
||||||
int status = 0;
|
int status = 0;
|
||||||
// gcc's implementation of typeid(T).name() mangles the type name,
|
// gcc's implementation of typeid(T).name() mangles the type name,
|
||||||
// so we have to demangle it.
|
// so we have to demangle it.
|
||||||
@ -84,7 +86,7 @@ String GetTypeName() {
|
|||||||
return name_str;
|
return name_str;
|
||||||
#else
|
#else
|
||||||
return name;
|
return name;
|
||||||
#endif // __GNUC__
|
#endif // __GLIBCXX__
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return "<type>";
|
return "<type>";
|
||||||
|
@ -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
|
#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>
|
#include <cxxabi.h>
|
||||||
#endif // __GNUC__
|
#endif // __GLIBCXX__
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
@ -74,7 +76,7 @@ String GetTypeName() {
|
|||||||
#if GTEST_HAS_RTTI
|
#if GTEST_HAS_RTTI
|
||||||
|
|
||||||
const char* const name = typeid(T).name();
|
const char* const name = typeid(T).name();
|
||||||
#ifdef __GNUC__
|
#ifdef __GLIBCXX__
|
||||||
int status = 0;
|
int status = 0;
|
||||||
// gcc's implementation of typeid(T).name() mangles the type name,
|
// gcc's implementation of typeid(T).name() mangles the type name,
|
||||||
// so we have to demangle it.
|
// so we have to demangle it.
|
||||||
@ -84,7 +86,7 @@ String GetTypeName() {
|
|||||||
return name_str;
|
return name_str;
|
||||||
#else
|
#else
|
||||||
return name;
|
return name;
|
||||||
#endif // __GNUC__
|
#endif // __GLIBCXX__
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return "<type>";
|
return "<type>";
|
||||||
|
Loading…
Reference in New Issue
Block a user