mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-27 08:22:31 +00:00
be7ce4110e
This reverts commit e96515433d
.
20 lines
426 B
C++
20 lines
426 B
C++
// Test for cross-vendor C++ ABI's __cxa_demangle function.
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <stdexcept>
|
|
#include <typeinfo>
|
|
|
|
#include <cxxabi.h>
|
|
|
|
int main()
|
|
{
|
|
int status = 0;
|
|
char *name =
|
|
abi::__cxa_demangle(typeid(10).name(), nullptr, nullptr, &status);
|
|
if (status != 0)
|
|
throw std::runtime_error("Demangle failed!");
|
|
int result = std::strcmp(name, "int");
|
|
std::free(name);
|
|
return result;
|
|
}
|