diff options
| author | Michael Neuling <michaelneuling@tenstorrent.com> | 2024-12-21 21:38:50 +0530 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2024-12-21 21:38:50 +0530 |
| commit | d539d64a23bbd64ba324eed595449bcc9c7be0cb (patch) | |
| tree | bc44c2e159e3a64bd0b29de45392f0a0f91ab30d /include | |
| parent | 91196d76b7919fefa382b65f2416f4327435e3a1 (diff) | |
| download | opensbi-d539d64a23bbd64ba324eed595449bcc9c7be0cb.zip opensbi-d539d64a23bbd64ba324eed595449bcc9c7be0cb.tar.gz opensbi-d539d64a23bbd64ba324eed595449bcc9c7be0cb.tar.bz2 | |
include: sbi: Fix compiling with C23 enabled compilers
C23 pre-defines bool so we need to gate our defines.
Signed-off-by: Michael Neuling <michaelneuling@tenstorrent.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_types.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h index a9943d2..90b0d45 100644 --- a/include/sbi/sbi_types.h +++ b/include/sbi/sbi_types.h @@ -44,7 +44,12 @@ typedef unsigned long long uint64_t; #error "Unexpected __riscv_xlen" #endif -typedef int bool; +#if __STDC_VERSION__ < 202000L +typedef _Bool bool; +#define true 1 +#define false 0 +#endif + typedef unsigned long ulong; typedef unsigned long uintptr_t; typedef unsigned long size_t; @@ -61,9 +66,6 @@ typedef uint32_t be32_t; typedef uint64_t le64_t; typedef uint64_t be64_t; -#define true 1 -#define false 0 - #define NULL ((void *)0) #define __packed __attribute__((packed)) |
