Эх сурвалжийг харах

tools: include necessary headers explicitly

Several host-tools use "bool" type without including <stdbool.h>.
This relies on the crappy header inclusion chain.

tools/Makefile has the following line:

  HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \

All host-tools are forced to include libfdt_env.h even if they are
totally unrelated to FDT.  Then, <stdbool.h> is indirectly included
as follows:

     include/libfdt_env.h
  -> include/linux/types.h
  -> <stdbool.h>

I am fixing this horrible crap.  In advance, I need to add necessary
include directives explicitly.  tools/fdtgrep.c needs more; <fctl.h>
for open() and <errno.h> for errno.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada 7 жил өмнө
parent
commit
d2bf1152c0

+ 3 - 0
tools/fdtgrep.c

@@ -10,7 +10,10 @@
 
 
 #include <assert.h>
 #include <assert.h>
 #include <ctype.h>
 #include <ctype.h>
+#include <errno.h>
 #include <getopt.h>
 #include <getopt.h>
+#include <fcntl.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>

+ 1 - 0
tools/gen_ethaddr_crc.c

@@ -6,6 +6,7 @@
  */
  */
 
 
 #include <ctype.h>
 #include <ctype.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>

+ 1 - 0
tools/ifdtool.c

@@ -12,6 +12,7 @@
 #include <assert.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <getopt.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>

+ 1 - 0
tools/imagetool.h

@@ -12,6 +12,7 @@
 #include "os_support.h"
 #include "os_support.h"
 #include <errno.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <fcntl.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>

+ 1 - 0
tools/mips-relocs.c

@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <limits.h>
 #include <limits.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/mman.h>