From 4760e1f7429e1a96e3efbb11f68071b460051e48 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 3 Jan 2026 13:19:51 +0100 Subject: [PATCH] stdbool.h: bool is now typedef'd to _Bool compiler intrinsic instead of char. This and the t/f enum is now guarded behind a stdc check. --- kern/libkern/stdbool.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kern/libkern/stdbool.h b/kern/libkern/stdbool.h index 9d50331..84e4d6d 100644 --- a/kern/libkern/stdbool.h +++ b/kern/libkern/stdbool.h @@ -1,8 +1,10 @@ #ifndef _STDBOOL_H #define _STDBOOL_H -/*TODO*/ -typedef char bool; -enum { false = 0, true = 1 }; +/* Otherwise, bool, true and false are keywords. */ +#if !(defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L) +typedef _Bool bool; +enum : bool { false = 0, true = 1 }; +#endif #endif // _STDBOOL_H