]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xenlight_stubs.c: Allow it to build with ocaml 3.09.3
authorDon Slutz <dslutz@verizon.com>
Fri, 7 Feb 2014 21:51:51 +0000 (16:51 -0500)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 11 Feb 2014 12:44:46 +0000 (12:44 +0000)
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 <dslutz@verizon.com>
Acked-by: David Scott <dave.scott@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/ocaml/libs/xl/xenlight_stubs.c

index 23f253a27687a86caedaaebbdd3fd204fceafbf7..8e825aec9ef9396e99a9fd2f1f63d38f1e05a23d 100644 (file)
 
 #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; \