From 4a7e48ed5d7d27ba7187a6aad88c4d26fb733916 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 18 Dec 2022 17:14:12 +0100 Subject: [PATCH] Make sure wchar_t is wide enough to hold all Unicode code-points Too bad if it isn't. --- luna/src/Utf8.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luna/src/Utf8.cpp b/luna/src/Utf8.cpp index 4445c355..0e543381 100644 --- a/luna/src/Utf8.cpp +++ b/luna/src/Utf8.cpp @@ -1,6 +1,8 @@ #include #include +static_assert(__WCHAR_MAX__ > 0x10ffff); + static Result utf8_char_length(char c) { if ((c & 0b11111000) == 0b11110000) return 4;