Thu Jun 9 17:11:27 2022 UTC ()
Avoid redefinition of Val_none and Some_val; fixes PR pkg/56873
(bouyer)
diff -r1.9 -r1.10 pkgsrc/sysutils/xentools415/distinfo
diff -r0 -r1.1 pkgsrc/sysutils/xentools415/patches/patch-tools_ocaml_libs_xc_xenctrl_stubs.c
diff -r0 -r1.1 pkgsrc/sysutils/xentools415/patches/patch-tools_ocaml_libs_xentoollog_xentoollog_stubs.c
diff -r0 -r1.1 pkgsrc/sysutils/xentools415/patches/patch-tools_ocaml_libs_xl_xenlight_stubs.c
--- pkgsrc/sysutils/xentools415/distinfo 2022/05/30 09:09:33 1.9
+++ pkgsrc/sysutils/xentools415/distinfo 2022/06/09 17:11:27 1.10
$NetBSD: patch-tools_ocaml_libs_xc_xenctrl_stubs.c,v 1.1 2022/06/09 17:11:27 bouyer Exp $
avoid xenctrl_stubs.c:46: error: "Val_none" redefined [-Werror]
--- ./tools/ocaml/libs/xc/xenctrl_stubs.c.orig 2022-06-09 18:27:02.969197078 +0200
+++ ./tools/ocaml/libs/xc/xenctrl_stubs.c 2022-06-09 18:27:19.448183361 +0200
@@ -43,7 +43,9 @@
#define _H(__h) ((xc_interface *)(__h))
#define _D(__d) ((uint32_t)Int_val(__d))
+#ifndef Val_none
#define Val_none (Val_int(0))
+#endif
#define string_of_option_array(array, index) \
((Field(array, index) == Val_none) ? NULL : String_val(Field(Field(array, index), 0)))
$NetBSD: patch-tools_ocaml_libs_xentoollog_xentoollog_stubs.c,v 1.1 2022/06/09 17:11:27 bouyer Exp $
Avoid xentoollog_stubs.c:57: error: "Some_val" redefined [-Werror]
--- ./tools/ocaml/libs/xentoollog/xentoollog_stubs.c.orig 2022-01-31 10:42:09.000000000 +0100
+++ ./tools/ocaml/libs/xentoollog/xentoollog_stubs.c 2022-06-09 18:22:10.699889986 +0200
@@ -53,8 +53,12 @@
#include "_xtl_levels.inc"
/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
#define Val_none Val_int(0)
+#endif
+#ifndef Some_val
#define Some_val(v) Field(v,0)
+#endif
static value Val_some(value v)
{
$NetBSD: patch-tools_ocaml_libs_xl_xenlight_stubs.c,v 1.1 2022/06/09 17:11:27 bouyer Exp $
avoid xenlight_stubs.c:231: error: "Some_val" redefined [-Werror]
--- ./tools/ocaml/libs/xl/xenlight_stubs.c.orig 2022-06-09 18:29:38.816998959 +0200
+++ ./tools/ocaml/libs/xl/xenlight_stubs.c 2022-06-09 18:30:07.080850306 +0200
@@ -227,8 +227,12 @@
}
/* Option type support as per http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php */
+#ifndef Val_none
#define Val_none Val_int(0)
+#endif
+#ifndef Some_val
#define Some_val(v) Field(v,0)
+#endif
static value Val_some(value v)
{