diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h index def88bba..cba787b2 100644 --- a/include/sbi/sbi_types.h +++ b/include/sbi/sbi_types.h @@ -44,7 +44,11 @@ typedef unsigned long long uint64_t; #error "Unexpected __riscv_xlen" #endif +#if __STDC_VERSION__ < 202000L typedef int bool; +#define true 1 +#define false 0 +#endif typedef unsigned long ulong; typedef unsigned long uintptr_t; typedef unsigned long size_t; @@ -61,9 +65,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)) diff --git a/include/sbi_utils/serial/semihosting.h b/include/sbi_utils/serial/semihosting.h index 8cc4a86c..5297cb07 100644 --- a/include/sbi_utils/serial/semihosting.h +++ b/include/sbi_utils/serial/semihosting.h @@ -38,7 +38,7 @@ enum semihosting_open_mode { #ifdef CONFIG_SERIAL_SEMIHOSTING int semihosting_init(void); -int semihosting_enabled(void); +bool semihosting_enabled(void); #else static inline int semihosting_init(void) { return SBI_ENODEV; } static inline int semihosting_enabled(void) { return 0; }