From 156fb83007a724f5d9c8e0fbec08afccbf923a8f Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Thu, 8 Oct 2026 22:02:17 +0200 Subject: [PATCH] include/stdbool.h: Define true and false as the integer constants 1 and 0. C99 7.16 requires true and false to expand to the integer constants 1 and 0, suitable for use in #if. NuttX defined them as (bool)1 and (bool)0, so a preprocessor condition such as "#if !true" did not compile. Define them as 1 and 0. The values do not change; only their type in an expression changes, from bool to int, as the standard requires. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli --- include/stdbool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stdbool.h b/include/stdbool.h index daabbc69d05..847f20068fd 100644 --- a/include/stdbool.h +++ b/include/stdbool.h @@ -76,8 +76,8 @@ # define bool uint8_t # endif -# define true (bool)1 -# define false (bool)0 +# define true 1 +# define false 0 # define __bool_true_false_are_defined 1 # else