aboutsummaryrefslogtreecommitdiff
path: root/src/unicode.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-10-30 12:24:23 +0000
committerGitHub <noreply@github.com>2024-10-30 12:24:23 +0000
commitf469bbb0049f618d09dd1dd962389c8306db6bbc (patch)
treec9fc02d1e8a7583ba339d8402f17ff6874403394 /src/unicode.cpp
parentee76acd665911e2f28d5183b3c0a07a665dbf858 (diff)
parentb59647084b11a7f08ad3aa54ae47ceb157f12c46 (diff)
Merge pull request #4425 from bobsayshilol/misc-fixes
Misc fixes
Diffstat (limited to 'src/unicode.cpp')
-rw-r--r--src/unicode.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/unicode.cpp b/src/unicode.cpp
index 665d5b182..cb9fb12ab 100644
--- a/src/unicode.cpp
+++ b/src/unicode.cpp
@@ -1,10 +1,15 @@
-#pragma warning(push)
-#pragma warning(disable: 4245)
+#if defined(GB_SYSTEM_WINDOWS)
+ #pragma warning(push)
+ #pragma warning(disable: 4245)
+#endif
extern "C" {
#include "utf8proc/utf8proc.c"
}
-#pragma warning(pop)
+
+#if defined(GB_SYSTEM_WINDOWS)
+ #pragma warning(pop)
+#endif
gb_internal bool rune_is_letter(Rune r) {
@@ -109,7 +114,7 @@ gb_internal isize utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out)
u8 b1, b2, b3;
Utf8AcceptRange accept;
if (x >= 0xf0) {
- Rune mask = (cast(Rune)x << 31) >> 31;
+ Rune mask = -cast(Rune)(x & 1);
codepoint = (cast(Rune)s0 & (~mask)) | (GB_RUNE_INVALID & mask);
width = 1;
goto end;