mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 19:39:06 -05:00
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:
@@ -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
|
||||
|
||||
16
tools/include/nolibc/stdbool.h
Normal file
16
tools/include/nolibc/stdbool.h
Normal 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 */
|
||||
Reference in New Issue
Block a user