1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:37:35 +00:00

AK+Toolchain: Make char and wchar_t behave on AARCH64

By default char and wchar_t are unsigned on AARCH64. This fixes a
bunch of related compiler errors.
This commit is contained in:
Gunnar Beutner 2022-10-12 22:00:21 +02:00 committed by Linus Groh
parent 31bd5b1a02
commit a650c74b27
4 changed files with 29 additions and 10 deletions

View file

@ -270,9 +270,11 @@ public:
return m_view.visit(
[&](StringView view) -> u32 {
auto ch = view[index];
if (ch < 0)
return 256u + ch;
return ch;
if constexpr (IsSigned<char>) {
if (ch < 0)
return 256u + ch;
return ch;
}
},
[&](Utf32View const& view) -> u32 { return view[index]; },
[&](Utf16View const& view) -> u32 { return view.code_point_at(index); },