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 <marco.casaroli@gmail.com>
This commit is contained in:
Marco Casaroli 2026-10-08 22:02:17 +02:00 • committed by Alan C. Assis
parent f1e89bf11e
commit 156fb83007

View file

@ -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