Skip to content

Commit

Permalink
Add support for C23 bool type
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelfj committed Mar 9, 2024
1 parent c8200b8 commit 81d4ba6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion include/flatcc/portable/pstdbool.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@

#include <stdbool.h>

#elif (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202300L)

/* C23 changed the bool type. */
#define true true
#define false false
#define bool bool

#define __bool_true_false_are_defined 1

#elif (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
/* C99 or newer */

/* C99 or newer, and older than C23 */
#define bool _Bool
#define true 1
#define false 0
Expand Down

0 comments on commit 81d4ba6

Please sign in to comment.