]> xenbits.xensource.com Git - xen.git/commitdiff
tools/ocaml/libs: Don't declare stubs as taking void
authorEdwin Török <edwin.torok@cloud.com>
Thu, 12 Jan 2023 11:28:29 +0000 (11:28 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 6 Feb 2023 10:22:12 +0000 (10:22 +0000)
There is no such thing as an Ocaml function (C stub or otherwise) taking no
parameters.  In the absence of any other parameters, unit is still passed.

This doesn't explode with any ABI we care about, but would malfunction for an
ABI environment such as stdcall.

Fixes: c3afd398ba7f ("ocaml: Add XS bindings.")
Fixes: 8b7ce06a2d34 ("ocaml: Add XC bindings.")
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/libs/xb/xenbus_stubs.c
tools/ocaml/libs/xc/xenctrl_stubs.c

index 3065181a55e666898943054f271bdd8c0d11e97d..97116b07826a764531088fd7937e8b95c5e42916 100644 (file)
 #include <xenctrl.h>
 #include <xen/io/xs_wire.h>
 
-CAMLprim value stub_header_size(void)
+CAMLprim value stub_header_size(value unit)
 {
-       CAMLparam0();
-       CAMLreturn(Val_int(sizeof(struct xsd_sockmsg)));
+       return Val_int(sizeof(struct xsd_sockmsg));
 }
 
 CAMLprim value stub_header_of_string(value s)
index 2fba9c5e94d60294de1df8374dbd99ba651dc6f7..7288184459757d2945632a6543e5cb14e8aa2094 100644 (file)
@@ -86,9 +86,9 @@ static void Noreturn failwith_xc(xc_interface *xch)
        caml_raise_with_string(*caml_named_value("xc.error"), error_str);
 }
 
-CAMLprim value stub_xc_interface_open(void)
+CAMLprim value stub_xc_interface_open(value unit)
 {
-       CAMLparam0();
+       CAMLparam1(unit);
        CAMLlocal1(result);
        xc_interface *xch;