diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-07 18:36:50 (GMT) |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-04-07 18:36:50 (GMT) |
commit | 741d6c0d475664fc48790917cefed455a4307227 (patch) | |
tree | 91de61aa484a7ec79aeae5e4ae78184ec8d920b2 /include/gtest/internal/gtest-type-util.h | |
parent | 661758ec1a26a7a2d745e89450cd4e603549cf8c (diff) | |
download | googletest-741d6c0d475664fc48790917cefed455a4307227.zip googletest-741d6c0d475664fc48790917cefed455a4307227.tar.gz googletest-741d6c0d475664fc48790917cefed455a4307227.tar.bz2 |
makes gtest compatible with HP UX (by Pasi Valminen); fixes a typo in the name of xlC (by Hady Zalek).
Diffstat (limited to 'include/gtest/internal/gtest-type-util.h')
-rw-r--r-- | include/gtest/internal/gtest-type-util.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/gtest/internal/gtest-type-util.h b/include/gtest/internal/gtest-type-util.h index ec9315d..b7b01b0 100644 --- a/include/gtest/internal/gtest-type-util.h +++ b/include/gtest/internal/gtest-type-util.h @@ -51,6 +51,8 @@ // libstdc++ (which is where cxxabi.h comes from). # ifdef __GLIBCXX__ # include <cxxabi.h> +# elif defined(__HP_aCC) +# include <acxx_demangle.h> # endif // __GLIBCXX__ namespace testing { @@ -64,17 +66,20 @@ String GetTypeName() { # if GTEST_HAS_RTTI const char* const name = typeid(T).name(); -# ifdef __GLIBCXX__ +# if defined(__GLIBCXX__) || defined(__HP_aCC) int status = 0; // gcc's implementation of typeid(T).name() mangles the type name, // so we have to demangle it. - char* const readable_name = abi::__cxa_demangle(name, 0, 0, &status); +# ifdef __GLIBCXX__ + using abi::__cxa_demangle; +# endif // __GLIBCXX__ + char* const readable_name = __cxa_demangle(name, 0, 0, &status); const String name_str(status == 0 ? readable_name : name); free(readable_name); return name_str; # else return name; -# endif // __GLIBCXX__ +# endif // __GLIBCXX__ || __HP_aCC # else |