[PATCH v2 3/7] include: hexdump: make hex2bin() usable from host tools
Daniel Golle
daniel at makrotopia.org
Fri Apr 24 19:31:27 CEST 2026
On Thu, Apr 16, 2026 at 01:00:31PM +0200, Heinrich Schuchardt wrote:
> Am 16. April 2026 03:46:42 MESZ schrieb Daniel Golle <daniel at makrotopia.org>:
> >Make hexdump.h work in host-tool builds by using 'uint8_t' instead
> >of 'u8', and including either user-space libc <ctype.h> for host-tools
> >or <linux/ctype.h> when building U-Boot itself.
> >
> >Signed-off-by: Daniel Golle <daniel at makrotopia.org>
> >---
> >v2: new patch
> >
> > include/hexdump.h | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> >diff --git a/include/hexdump.h b/include/hexdump.h
> >index f2ca4793d69..5cb48d79efe 100644
> >--- a/include/hexdump.h
> >+++ b/include/hexdump.h
> >@@ -7,7 +7,11 @@
> > #ifndef HEXDUMP_H
> > #define HEXDUMP_H
> >
> >+#ifdef USE_HOSTCC
> >+#include <ctype.h>
> >+#else
> > #include <linux/ctype.h>
>
> uin8_t is defined in stdint.h.
> Don't we need it in the HOSTCC case?
tools/Makefile force-includes include/compiler.h for every host-tool
compiler.h, and that unconditionally #include <stdint.h> in its
USE_HOSTCC.
While uint*_t are widely used, the general mechanism seems to be to
rely on compiler.h rather than explicitely including stdint.h
(but exceptions do exist)
More information about the U-Boot
mailing list