Control: tags -1 + patch

On Thu, 20 Jun 2024 06:36:05 +0000 Stephane Glondu <glo...@debian.org> wrote:
Your package FTBFS with OCaml 5.2.0 for the following reason:

  Problem in C stubs

Attached is a patch that fixes the issues. It should also work with the version of OCaml currently in unstable.


Cheers,

--
Stéphane
From: Stephane Glondu <glo...@debian.org>
Date: Fri, 21 Jun 2024 07:46:23 +0200
Subject: [PATCH] Fix compilation with OCaml 5.2.0

Bug-Debian: https://bugs.debian.org/1073913
---
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c | 5 +++++
 tools/ocaml/libs/xl/xenlight_stubs.c           | 5 +++++
 tools/ocaml/xenstored/disk.ml                  | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index e4306a0c2f..70b0b30e42 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -32,9 +32,14 @@
 #include "caml_xentoollog.h"
 
 /* The following is equal to the CAMLreturn macro, but without the return */
+#ifdef CAMLdrop
+/* CAMLdrop was introduced in OCaml 4.03.0 */
+#define CAMLdone CAMLdrop
+#else
 #define CAMLdone do{ \
 caml_local_roots = caml__frame; \
 }while (0)
+#endif
 
 #define XTL ((xentoollog_logger *) Xtl_val(handle))
 
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 45b8af61c7..641ca831a5 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -49,9 +49,14 @@
 #endif
 
 /* The following is equal to the CAMLreturn macro, but without the return */
+#ifdef CAMLdrop
+/* CAMLdrop was introduced in OCaml 4.03.0 */
+#define CAMLdone CAMLdrop
+#else
 #define CAMLdone do{ \
 caml_local_roots = caml__frame; \
 }while (0)
+#endif
 
 #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x)))
 #define CTX ((libxl_ctx *) Ctx_val(ctx))
diff --git a/tools/ocaml/xenstored/disk.ml b/tools/ocaml/xenstored/disk.ml
index 4739967b61..1ca0e2a95e 100644
--- a/tools/ocaml/xenstored/disk.ml
+++ b/tools/ocaml/xenstored/disk.ml
@@ -30,7 +30,7 @@ let undec c =
 	| _          -> raise (Failure "undecify")
 
 let unhex c =
-	let c = Char.lowercase c in
+	let c = Char.lowercase_ascii c in
 	match c with
 	| '0' .. '9' -> (Char.code c) - (Char.code '0')
 	| 'a' .. 'f' -> (Char.code c) - (Char.code 'a') + 10
-- 
2.43.0

Reply via email to