mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
1b81bb49b4
Official docs: Some headers from C library were deprecated in C++ and are no longer welcome in C++ codebases. Some have no effect in C++. For more details refer to the C++ 14 Standard [depr.c.headers] section. This check replaces C standard library headers with their C++ alternatives and removes redundant ones.
27 lines
521 B
C++
27 lines
521 B
C++
#include <base/demangle.h>
|
|
|
|
#include <cstdlib>
|
|
#include <cxxabi.h>
|
|
|
|
static DemangleResult tryDemangle(const char * name, int & status)
|
|
{
|
|
return DemangleResult(abi::__cxa_demangle(name, nullptr, nullptr, &status));
|
|
}
|
|
|
|
DemangleResult tryDemangle(const char * name)
|
|
{
|
|
int status = 0;
|
|
return tryDemangle(name, status);
|
|
}
|
|
|
|
std::string demangle(const char * name, int & status)
|
|
{
|
|
auto result = tryDemangle(name, status);
|
|
if (result)
|
|
{
|
|
return std::string(result.get());
|
|
}
|
|
|
|
return name;
|
|
}
|