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:
Thomas Weißschuh 2024-07-25 19:10:44 +02:00
parent 6ea2987c9a
commit ae1f550efc
3 changed files with 19 additions and 1 deletions

View File

@ -35,6 +35,7 @@ all_files := \
stackprotector.h \
std.h \
stdarg.h \
stdbool.h \
stdint.h \
stdlib.h \
string.h \

View File

@ -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

View File

@ -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 */