]> Gentwo Git Trees - linux/.git/commitdiff
tools/nolibc: add the more portable inttypes.h
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Nov 2025 13:21:28 +0000 (14:21 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 2 Nov 2025 13:28:20 +0000 (14:28 +0100)
It's often recommended to only use inttypes.h instead of stdint.h for
portability reasons since the former is always present when the latter
is present, but not conversely, and the former includes the latter. Due
to this some simple programs fail to build when including inttypes.h.
Let's add one that simply includes nolibc.h to better support these
programs.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/Makefile
tools/include/nolibc/inttypes.h [new file with mode: 0644]

index 5a07e1d37adf3910db9d9e9e06ea0a217dd19430..6e31187c89aac66ddf5c61bcb404041783826945 100644 (file)
@@ -33,6 +33,7 @@ all_files := \
                errno.h \
                fcntl.h \
                getopt.h \
+               inttypes.h \
                limits.h \
                math.h \
                nolibc.h \
diff --git a/tools/include/nolibc/inttypes.h b/tools/include/nolibc/inttypes.h
new file mode 100644 (file)
index 0000000..1977bd7
--- /dev/null
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
+
+#include "nolibc.h"