summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-12-20 10:35:42 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-12-21 21:24:36 +0330
commitccb9cae8e903a8043f813675639831e1890190c7 (patch)
tree753e8edd9466d8dd1621f3c47ca0686ec044fd0c
parent0d7d2b825ef92111b2cf104e7c37ce14e941c5a0 (diff)
downloadserenity-ccb9cae8e903a8043f813675639831e1890190c7.zip
LibC: Make WEOF a signed value on clang
The actual value is unchanged, but the previous `0xffffffff` was an unsigned value, which lead to clang getting mad at `foowc() == WEOF`. This commit makes it a signed int on clang, which *should* serve the same purpose and not lead to clang getting mad at us.
-rw-r--r--Userland/Libraries/LibC/wchar.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/wchar.h b/Userland/Libraries/LibC/wchar.h
index 17f0af3209..09119d1ba7 100644
--- a/Userland/Libraries/LibC/wchar.h
+++ b/Userland/Libraries/LibC/wchar.h
@@ -13,8 +13,13 @@
__BEGIN_DECLS
+// Note: wint_t is unsigned on gcc, and signed on clang.
#ifndef WEOF
-# define WEOF (0xffffffffu)
+# ifdef __clang__
+# define WEOF (-1)
+# else
+# define WEOF (0xffffffffu)
+# endif
#endif
#undef WCHAR_MAX