]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
mkimage: make it easier to run syntax checkers on grub-mkimagexx.c
authorPeter Jones <pjones@redhat.com>
Wed, 21 Feb 2018 20:20:24 +0000 (15:20 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 5 Mar 2018 12:44:55 +0000 (13:44 +0100)
This makes it so you can treat grub-mkimagexx.c as a file you can build
directly, so syntax checkers like vim's "syntastic" plugin, which uses
"gcc -x c -fsyntax-only" to build it, will work.

One still has to do whatever setup is required to make it pick the right
include dirs, which -W options we use, etc., but this makes it so you
can do the checking on the file you're editing, rather than on a
different file.

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkimage32.c
util/grub-mkimage64.c
util/grub-mkimagexx.c

index 9b31397bc40b95b69a1edc4f2d4c4b5d6eaa63cd..1f2ccccd225bbbb32e7e38801ddafeb90d9a69bb 100644 (file)
@@ -19,4 +19,6 @@
 # define ELF_ST_TYPE(val)              ELF32_ST_TYPE(val)
 #define XEN_NOTE_SIZE 132
 
+#ifndef GRUB_MKIMAGEXX
 #include "grub-mkimagexx.c"
+#endif
index d83345924705353b3c20a1e4dd087371ec5383ec..4ff72a625e0030d05cee0675a481b0803cda081e 100644 (file)
@@ -19,4 +19,6 @@
 # define ELF_ST_TYPE(val)              ELF64_ST_TYPE(val)
 #define XEN_NOTE_SIZE 120
 
+#ifndef GRUB_MKIMAGEXX
 #include "grub-mkimagexx.c"
+#endif
index 39d7efb914a43b93ef63f45872f681d2f1a09f73..97ff599f0730847ab4f59af5fa5085a5a027ed7e 100644 (file)
 
 #pragma GCC diagnostic ignored "-Wcast-align"
 
+#define GRUB_MKIMAGEXX
+#if !defined(MKIMAGE_ELF32) && !defined(MKIMAGE_ELF64)
+#if __SIZEOF_POINTER__ == 8
+#include "grub-mkimage64.c"
+#else
+#include "grub-mkimage32.c"
+#endif
+#endif
+
 /* These structures are defined according to the CHRP binding to IEEE1275,
    "Client Program Format" section.  */