Hello Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/36837
to review the following change.
Change subject: include: Make stdbool.h a separate file ......................................................................
include: Make stdbool.h a separate file
This patch moves the traditional POSIX stdbool.h definitions out from stdint.h into their own file. This helps for using these definitions in commonlib code which may be compiled in different environments. For coreboot everything should chain-include this stuff via types.h anyway so nothing should change.
Change-Id: Ic8d52be80b64d8e9564f3aee8975cb25e4c187f5 Signed-off-by: Julius Werner jwerner@chromium.org --- A src/include/stdbool.h M src/include/stdint.h M src/include/types.h 3 files changed, 16 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/36837/1
diff --git a/src/include/stdbool.h b/src/include/stdbool.h new file mode 100644 index 0000000..ce45686 --- /dev/null +++ b/src/include/stdbool.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __STDBOOL_H__ +#define __STDBOOL_H__ + +#ifdef __ROMCC__ +typedef uint8_t bool; +#else +typedef _Bool bool; +#endif +#define true 1 +#define false 0 + +#endif /* __STDBOOL_H__ */ diff --git a/src/include/stdint.h b/src/include/stdint.h index 0a8e153..67b0b0b 100644 --- a/src/include/stdint.h +++ b/src/include/stdint.h @@ -101,13 +101,4 @@ #define UINTMAX_MAX UINT64_MAX #endif
-/* TODO: move into stdbool.h */ -#ifdef __ROMCC__ -typedef uint8_t bool; -#else -typedef _Bool bool; -#endif -#define true 1 -#define false 0 - #endif /* STDINT_H */ diff --git a/src/include/types.h b/src/include/types.h index 5902bc2..30f243f 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -16,7 +16,8 @@ #ifndef __TYPES_H #define __TYPES_H
-/* types.h is supposed to provide stdint and stddef defined in here: */ +/* types.h is supposed to provide the standard headers defined in here: */ +#include <stdbool.h> #include <stdint.h> #include <stddef.h>