mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Turn off demangler in userland
For some reason, the default CXXFLAGS and such don't get us the __cxa_demangle symbol in userland.
This commit is contained in:
committed by
Andreas Kling
parent
96a86463dd
commit
c24fe710d7
@@ -7,15 +7,18 @@ namespace AK {
|
|||||||
|
|
||||||
inline String demangle(const char* name)
|
inline String demangle(const char* name)
|
||||||
{
|
{
|
||||||
|
#ifdef KERNEL
|
||||||
int status = 0;
|
int status = 0;
|
||||||
auto* demangled_name = abi::__cxa_demangle(name, nullptr, nullptr, &status);
|
auto* demangled_name = abi::__cxa_demangle(name, nullptr, nullptr, &status);
|
||||||
auto string = String(status == 0 ? demangled_name : name);
|
auto string = String(status == 0 ? demangled_name : name);
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
kfree(demangled_name);
|
kfree(demangled_name);
|
||||||
return string;
|
return string;
|
||||||
|
#else
|
||||||
|
return name;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using AK::demangle;
|
using AK::demangle;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user