From: Stefano Stabellini Subject: Re: [PATCH 1/5] xen: improve changes to xen_add_to_physmap Date: Tue, 7 Aug 2012 18:07:21 +0100 Message-ID: References: <1344262325-26598-1-git-send-email-stefano.stabellini@eu.citrix.com> <501FFFB50200007800092FC7@nat28.tlf.novell.com> <502004BE0200007800093028@nat28.tlf.novell.com> <502131E202000078000933F9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <502131E202000078000933F9@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: "Tim Deegan (3P)" , Stefano Stabellini , "Jean Guyader (3P)" , xen-devel , Jean Guyader , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Tue, 7 Aug 2012, Jan Beulich wrote: > >>> On 07.08.12 at 14:40, Jean Guyader wrote: > > You could probably do something like > > > > #ifdef __GNUC__ > > # define UNION_NAME > > #else > > # define UNION_NAME u > > #endif > > union { > > /* Number of pages to go through for gmfn_range */ > > uint16_t size; > > /* IFF gmfn_foreign */ > > domid_t foreign_domid; > > } UNION_NAME; > > > > It's not ideal but this way you keep the binary compatibility and you > > also the code still cmopatible with GCC. > > Ah, yes, something along those lines might be okay; we already > have similar things e.g. for __DECL_REG() (note the additional > use of __STRICT_ANSI__ there, though). But it is strict ANSI. > The most problematic > thing here is the name space cluttering - UNION_NAME is certainly > not good, but __DECL_REG really is too unspecific too (yet we > got away with it so far). OK, I'll got for this strategy. Regarding the name, maybe it should be XEN_ADD_TO_PHYSMAP_FIELD? #if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || (__STDC_VERSION__ >= 201112L) # define XEN_ADD_TO_PHYSMAP_ARG #else # define XEN_ADD_TO_PHYSMAP_ARG u #endif