mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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:
parent
96a86463dd
commit
c24fe710d7
Notes:
sideshowbarker
2024-07-19 10:29:22 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/c24fe710d7a Pull-request: https://github.com/SerenityOS/serenity/pull/954 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 1 deletions
|
@ -7,15 +7,18 @@ namespace AK {
|
|||
|
||||
inline String demangle(const char* name)
|
||||
{
|
||||
#ifdef KERNEL
|
||||
int status = 0;
|
||||
auto* demangled_name = abi::__cxa_demangle(name, nullptr, nullptr, &status);
|
||||
auto string = String(status == 0 ? demangled_name : name);
|
||||
if (status == 0)
|
||||
kfree(demangled_name);
|
||||
return string;
|
||||
#else
|
||||
return name;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using AK::demangle;
|
||||
|
||||
|
|
Loading…
Reference in a new issue