mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
* Try fix travis * fix * Fix clickhouse-local shared-split link * fix * fix * fix * Build fixes * Fix tinfo * fix * tinfo -> termcap * termcap fix * Better llvm version detect * fix * Debian postinst fix Tests: use /usr/local if exists * Compile and doc fixes * fix * fix * fix * macos fixes * fix * wip * Update demangle.h * Update demangle.cpp
41 lines
608 B
C++
41 lines
608 B
C++
#include <common/demangle.h>
|
|
|
|
#if _MSC_VER
|
|
|
|
std::string demangle(const char * name, int & status)
|
|
{
|
|
status = 0;
|
|
return name;
|
|
}
|
|
|
|
#else
|
|
|
|
#include <stdlib.h>
|
|
#include <cxxabi.h>
|
|
|
|
std::string demangle(const char * name, int & status)
|
|
{
|
|
std::string res;
|
|
|
|
char * demangled_str = abi::__cxa_demangle(name, 0, 0, &status);
|
|
if (demangled_str)
|
|
{
|
|
try
|
|
{
|
|
res = demangled_str;
|
|
}
|
|
catch (...)
|
|
{
|
|
free(demangled_str);
|
|
throw;
|
|
}
|
|
free(demangled_str);
|
|
}
|
|
else
|
|
res = name;
|
|
|
|
return res;
|
|
}
|
|
|
|
#endif
|