From: Ian Campbell Subject: Re: [PATCH v2-resend 04/30] libxl: idl: complete some enums in the IDL with their defaults Date: Tue, 10 Sep 2013 12:02:17 +0100 Message-ID: <1378810937.21748.106.camel@kazak.uk.xensource.com> References: <1377168678-25492-1-git-send-email-rob.hoes@citrix.com> <1377168678-25492-5-git-send-email-rob.hoes@citrix.com> <21020.48655.713430.351144@mariner.uk.xensource.com> <1378810633.21748.100.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1378810633.21748.100.camel@kazak.uk.xensource.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: Ian Jackson Cc: Rob Hoes , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2013-09-10 at 11:57 +0100, Ian Campbell wrote: > On Tue, 2013-08-27 at 15:56 +0100, Ian Jackson wrote: > > Rob Hoes writes ("[Xen-devel] [PATCH v2-resend 04/30] libxl: idl: complete some enums in the IDL with their defaults"): > > > There are several enums in the IDL that are initialised to 0, while > > > the value 0 is not part of the enum itself. This creates problems for > > > language bindings generated from the IDL, such as the OCaml ones. > > > > > > Added an explicit (0, "UNKNOWN") enum value where appropriate, or used > > > init_val to default to a sensible value. > > > > Acked-by: Ian Jackson > > Applied. I think we don't need a raft of LIBXL_HAVE defines in this case, the addition is really for the benefit of autogenerated language bindings, anyone using C who cares about supporting older APIs would just use 0 and not do: #ifdef LIBXL_HAVE_A_THING enum thing foo = LIBXL_HAVE_A_THING #else num thing foo = 0; #endif Ian.