tools/nolibc: add the more portable inttypes.h
Willy Tarreau
maintainerPATCH v3 1/1 tools/nolibc: add the more portable inttypes.h
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 <[email protected]>
---
v3:
- include nolibc.h instead of stdint.h from inttypes.h so that everything is known at once. Just like with limits.h, this file is nothing more than a convenience for users to port applications and doesn't provide anything, so there's no point including it from nolibc.h
tools/include/nolibc/Makefile | 1 + tools/include/nolibc/inttypes.h | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 tools/include/nolibc/inttypes.h
tools/include/nolibc/Makefile +1 -0
@@ -33,6 +33,7 @@ all_files := \ errno.h \ fcntl.h \ getopt.h \ + inttypes.h \ limits.h \ math.h \ nolibc.h \
tools/include/nolibc/inttypes.h new file +2 -0
@@ -0,0 +1,2 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +#include "nolibc.h"
Signature · 1 line
2.17.5