From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [BUGFIX][PATCH 1/1] xenlight_stubs.c: Allow it to build with ocaml 3.09.3 Date: Mon, 10 Feb 2014 12:38:12 +0000 Message-ID: <52F8C834.5070104@eu.citrix.com> References: <1391809911-13610-1-git-send-email-dslutz@verizon.com> <1391809911-13610-2-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1391809911-13610-2-git-send-email-dslutz@verizon.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: Don Slutz , xen-devel@lists.xen.org Cc: Andrew Cooper , Stefano Stabellini , Ian Jackson , David Scott , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 02/07/2014 09:51 PM, Don Slutz wrote: > This code was copied from: > > http://docs.camlcity.org/docs/godisrc/oasis-ocaml-fd-1.1.1.tar.gz/ocaml-fd-1.1.1/lib/fd_stubs.c > > Signed-off-by: Don Slutz Release-acked-by: George Dunlap > --- > tools/ocaml/libs/xl/xenlight_stubs.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c > index 23f253a..8e825ae 100644 > --- a/tools/ocaml/libs/xl/xenlight_stubs.c > +++ b/tools/ocaml/libs/xl/xenlight_stubs.c > @@ -35,6 +35,19 @@ > > #include "caml_xentoollog.h" > > +/* > + * Starting with ocaml-3.09.3, CAMLreturn can only be used for ``value'' > + * types. CAMLreturnT was only added in 3.09.4, so we define our own > + * version here if needed. > + */ > +#ifndef CAMLreturnT > +#define CAMLreturnT(type, result) do { \ > + type caml__temp_result = (result); \ > + caml_local_roots = caml__frame; \ > + return (caml__temp_result); \ > +} while (0) > +#endif > + > /* The following is equal to the CAMLreturn macro, but without the return */ > #define CAMLdone do{ \ > caml_local_roots = caml__frame; \