mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
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:
parent
f1e89bf11e
commit
156fb83007
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue