From: Ian Jackson Subject: Re: [PATCH] Use new Xen public header for product numbers and names [and 1 more messages] Date: Mon, 1 Oct 2012 11:40:36 +0100 Message-ID: <20585.29476.782177.703044@mariner.uk.xensource.com> References: <20585.27847.174145.345965@mariner.uk.xensource.com> <1348667684-29202-1-git-send-email-paul.durrant@citrix.com> <20581.58542.402088.878499@mariner.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022EFF91D9EE4@LONPMAILBOX01.citrite.net> <291EDFCB1E9E224A99088639C4762022EFF91D9F18@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <291EDFCB1E9E224A99088639C4762022EFF91D9F18@LONPMAILBOX01.citrite.net>, List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser , Paul Durrant Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Paul Durrant writes ("RE: [Xen-devel] [PATCH] Use new Xen public header for product numbers and names"): > I liked it so that's what I did :-) I added a terminator entry for > convenience when defining an array. Not needed when defining a > switch statement but harmless since it's a case that should never be > hit. Very well. Keir Fraser writes ("Re: [Xen-devel] [PATCH] Use new Xen public header for product numbers and names"): > My usual way to do this would be to place the list in its own header file: > > pvdrivers_list.h: > EACH(WINDOWS, 0x0001, "xensource-windows") > EACH(...) > ... > > Then e.g., > #define EACH(name,num,string) PVDRIVERS_ID_##name = num, > enum { > #include "pvdrivers_list.h" > } > #undef EACH > > Which is a bit more abstruse on the consuming side, but does avoid the list > itself being an ugly multi-line macro monster. This is fine by me too. Thanks, Ian.