tools/nolibc: add stdbool.h header
stdbool.h is very simple. Provide an implementation for the user convenience. Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240725-nolibc-stdbool-v1-1-a6ee2c80bcde@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
parent
6ea2987c9a
commit
ae1f550efc
|
@ -35,6 +35,7 @@ all_files := \
|
|||
stackprotector.h \
|
||||
std.h \
|
||||
stdarg.h \
|
||||
stdbool.h \
|
||||
stdint.h \
|
||||
stdlib.h \
|
||||
string.h \
|
||||
|
|
|
@ -74,7 +74,8 @@
|
|||
* -I../nolibc -o hello hello.c -lgcc
|
||||
*
|
||||
* The available standard (but limited) include files are:
|
||||
* ctype.h, errno.h, signal.h, stdarg.h, stdio.h, stdlib.h, string.h, time.h
|
||||
* ctype.h, errno.h, signal.h, stdarg.h, stdbool.h stdio.h, stdlib.h,
|
||||
* string.h, time.h
|
||||
*
|
||||
* In addition, the following ones are expected to be provided by the compiler:
|
||||
* float.h, stddef.h
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
|
||||
/*
|
||||
* Boolean types support for NOLIBC
|
||||
* Copyright (C) 2024 Thomas Weißschuh <linux@weissschuh.net>
|
||||
*/
|
||||
|
||||
#ifndef _NOLIBC_STDBOOL_H
|
||||
#define _NOLIBC_STDBOOL_H
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* _NOLIBC_STDBOOL_H */
|
Loading…
Reference in New Issue