From ccb9cae8e903a8043f813675639831e1890190c7 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 20 Dec 2021 10:35:42 +0330 Subject: [PATCH] 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. --- Userland/Libraries/LibC/wchar.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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