summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-03 06:26:32 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-03 06:27:54 +0100
commitc600280ddec6d72f9db25b5e0827118ea03eac74 (patch)
treeac4869ee698c849f310f4639200e402f88b43b18 /AK
parent9dc78338ad962236af8b663bb739a3532536532a (diff)
downloadserenity-c600280ddec6d72f9db25b5e0827118ea03eac74.zip
AK: The <cxxabi.h> header is not available during Toolchain build
This will need some refinement, but basically since we build LibC during the toolchain build, we don't have libstdc++ headers yet.
Diffstat (limited to 'AK')
-rw-r--r--AK/Demangle.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/AK/Demangle.h b/AK/Demangle.h
index d898585fed..bc422f5f6b 100644
--- a/AK/Demangle.h
+++ b/AK/Demangle.h
@@ -27,18 +27,25 @@
#pragma once
#include <AK/String.h>
+
+#ifndef SERENITY_LIBC_BUILD
#include <cxxabi.h>
+#endif
namespace AK {
inline String demangle(const StringView& name)
{
+#ifdef SERENITY_LIBC_BUILD
+ return name;
+#else
int status = 0;
auto* demangled_name = abi::__cxa_demangle(String(name).characters(), nullptr, nullptr, &status);
auto string = String(status == 0 ? demangled_name : name);
if (status == 0)
kfree(demangled_name);
return string;
+#endif
}
}