From 08cf1e6e0a37f358ad99c8b0666685affa76e448 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Mon, 29 Jun 2026 01:00:35 +0300 Subject: [PATCH] fix: add wchar_t definition to stddef.h (C mode only, C++ has it as keyword) POSIX requires stddef.h to define wchar_t. Previously it was missing, which broke inttypes.h (wcstoimax/strtoimax use wchar_t). Fixed by adding guarded by since C++ has wchar_t as a built-in keyword. --- include/stddef.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/stddef.h b/include/stddef.h index 334267f457..a25ac8beb7 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -11,6 +11,10 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef long unsigned int size_t; +#ifndef __cplusplus +typedef int wchar_t; +#endif + typedef struct { long long __ll; long double __ld; } max_align_t; #define offsetof(type, member) __builtin_offsetof(type, member)