From 40771886ec3291e992bc96457f8c3ec37a640c6e Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Fri, 26 Oct 2018 02:03:40 +0200 Subject: [PATCH] loop: use XLAT_MACROS_ONLY instead of #stop As the former allows controlling presence of xlat definitions during the inclusion and not header generation. * xlat/loop_cmds.in: Remove #stop. * loop.c: Wrap "xlat/loop_cmds.h" inclusion in XLAT_MACROS_ONLY. * tests/ioctl_loop.c: Likewise. --- loop.c | 6 +++++- tests/ioctl_loop.c | 5 ++++- xlat/loop_cmds.in | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/loop.c b/loop.c index b29bf56e..466950e1 100644 --- a/loop.c +++ b/loop.c @@ -17,7 +17,11 @@ typedef struct loop_info struct_loop_info; #include MPERS_DEFS #include "print_fields.h" -#include "xlat/loop_cmds.h" + +#define XLAT_MACROS_ONLY +# include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY + #include "xlat/loop_flags_options.h" #include "xlat/loop_crypt_type_options.h" diff --git a/tests/ioctl_loop.c b/tests/ioctl_loop.c index 3f4fb0d9..59d98318 100644 --- a/tests/ioctl_loop.c +++ b/tests/ioctl_loop.c @@ -21,7 +21,10 @@ #include #include #include "print_fields.h" -#include "xlat/loop_cmds.h" + +#define XLAT_MACROS_ONLY +# include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY #ifndef ABBREV # define ABBREV 0 diff --git a/xlat/loop_cmds.in b/xlat/loop_cmds.in index c4728af3..939fb480 100644 --- a/xlat/loop_cmds.in +++ b/xlat/loop_cmds.in @@ -11,4 +11,3 @@ LOOP_SET_BLOCK_SIZE 0x4C09 LOOP_CTL_ADD 0x4C80 LOOP_CTL_REMOVE 0x4C81 LOOP_CTL_GET_FREE 0x4C82 -#stop -- 2.40.0