Received: from eggs.gnu.org ([2001:4830:134:3::10]:47483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDBf6-0002S0-7N for qemu-devel@nongnu.org; Tue, 11 Feb 2014 06:38:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDBez-0003e4-QR for qemu-devel@nongnu.org; Tue, 11 Feb 2014 06:38:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDBez-0003de-75 for qemu-devel@nongnu.org; Tue, 11 Feb 2014 06:37:53 -0500 From: Markus Armbruster References: <1390881230-14033-1-git-send-email-akong@redhat.com> <1390881230-14033-3-git-send-email-akong@redhat.com> Date: Tue, 11 Feb 2014 11:55:02 +0100 In-Reply-To: <1390881230-14033-3-git-send-email-akong@redhat.com> (Amos Kong's message of "Tue, 28 Jan 2014 11:53:47 +0800") Message-ID: <87k3d1syux.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/5] introduce two marcos to dump the options info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: jyang@redhat.com, laine@redhat.com, libvir-list@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com, lcapitulino@redhat.com Amos Kong writes: > We will use the marocs to generate two tables, which contain > the option name and argument information. > > Signed-off-by: Amos Kong > --- > qemu-options-wrapper.h | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h > index 13bfea0..c36a9ee 100644 > --- a/qemu-options-wrapper.h > +++ b/qemu-options-wrapper.h > @@ -18,6 +18,22 @@ > > #define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL) > > +#elif defined(QEMU_OPTIONS_GENERATE_NAME) > + > +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ > + option, > + > +#define DEFHEADING(text) > +#define ARCHHEADING(text, arch_mask) > + > +#elif defined(QEMU_OPTIONS_GENERATE_HASARG) > + > +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ > + stringify(opt_arg), > + > +#define DEFHEADING(text) > +#define ARCHHEADING(text, arch_mask) > + > #elif defined(QEMU_OPTIONS_GENERATE_OPTIONS) > > #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ > @@ -38,4 +54,6 @@ > > #undef QEMU_OPTIONS_GENERATE_ENUM > #undef QEMU_OPTIONS_GENERATE_HELP > +#undef QEMU_OPTIONS_GENERATE_NAME > +#undef QEMU_OPTIONS_GENERATE_HASPARAM > #undef QEMU_OPTIONS_GENERATE_OPTIONS Personally, I find this indirection through qemu-options-wrapper.h silly. The ultimate user could just as well define the necessary DEF macros itself, instead of telling a wrapper what it wants defined by defining yet another macro. Not your fault, and I'm not demanding you change it.