diff options
author | Tomas Chvatal <tchvatal@suse.cz> | 2012-08-11 11:04:58 +0200 |
---|---|---|
committer | Tomas Chvatal <tchvatal@suse.cz> | 2012-08-11 11:04:58 +0200 |
commit | 4942ae2fac693e35072d27564286d6852f964dab (patch) | |
tree | 1e4cf7039c4b3a5bb6adbc4bf72affcca20064ee | |
parent | e349cf4c312afbeeb388327848a4f3c0378be534 (diff) | |
parent | ec8f67b0bf103b553f435d3b969965f9cff58768 (diff) |
Merge branch 'master' into feature/buildsystem_rewritefeature/buildsystem_rewrite
Conflicts:
config/ax_cxx_gcc_abi_demangle.m4
-rw-r--r-- | m4/ax_cxx_gcc_abi_demangle.m4 | 2 | ||||
-rw-r--r-- | src/cppunit/TypeInfoHelper.cpp | 14 |
2 files changed, 12 insertions, 4 deletions
diff --git a/m4/ax_cxx_gcc_abi_demangle.m4 b/m4/ax_cxx_gcc_abi_demangle.m4 index 0275c7e..3f1876b 100644 --- a/m4/ax_cxx_gcc_abi_demangle.m4 +++ b/m4/ax_cxx_gcc_abi_demangle.m4 @@ -32,7 +32,7 @@ ax_cv_cxx_gcc_abi_demangle, AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <typeinfo> #include <cxxabi.h> -#include <malloc.h> +#include <cstdlib> #include <string> template<typename TYPE> diff --git a/src/cppunit/TypeInfoHelper.cpp b/src/cppunit/TypeInfoHelper.cpp index ff1d662..2df5786 100644 --- a/src/cppunit/TypeInfoHelper.cpp +++ b/src/cppunit/TypeInfoHelper.cpp @@ -6,7 +6,7 @@ #include <string> #if CPPUNIT_HAVE_GCC_ABI_DEMANGLE -#include <malloc.h> +#include <cstdlib> #include <cxxabi.h> #endif @@ -24,8 +24,16 @@ TypeInfoHelper::getClassName( const std::type_info &info ) c_name = abi::__cxa_demangle( info.name(), 0, 0, &status ); - std::string name( c_name ); - free( c_name ); + std::string name; + if(c_name) + { + name = std::string( c_name ); + free( c_name ); + } + else + { + name = std::string( info.name() ); + } #else // CPPUNIT_HAVE_GCC_ABI_DEMANGLE |