43 lines
1.5 KiB
Diff
43 lines
1.5 KiB
Diff
From 07ea5915766d829b62255fb2a94239a28f433159 Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Mon, 19 Jan 2026 21:36:08 +0000
|
|
Subject: [PATCH] generator/daemon.ml: Avoid not available macro for OCaml
|
|
functions
|
|
|
|
Reported-by: Toolybird
|
|
Fixes: https://github.com/libguestfs/libguestfs/issues/290
|
|
(cherry picked from commit 1b79e22be443b48dc2bdb518cfea14342b3d8136)
|
|
---
|
|
generator/daemon.ml | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/generator/daemon.ml b/generator/daemon.ml
|
|
index 65844309e..f1f954087 100644
|
|
--- a/generator/daemon.ml
|
|
+++ b/generator/daemon.ml
|
|
@@ -1054,7 +1054,8 @@ let generate_daemon_optgroups_h () =
|
|
pr "#define OPTGROUP_%s_NOT_AVAILABLE \\\n"
|
|
(String.uppercase_ascii group);
|
|
List.iter (
|
|
- fun { name; style = ret, args, optargs } ->
|
|
+ function
|
|
+ | { name; style = ret, args, optargs; impl = C } ->
|
|
let style = ret, args @ args_of_optargs optargs, [] in
|
|
pr " ";
|
|
generate_prototype
|
|
@@ -1065,6 +1066,11 @@ let generate_daemon_optgroups_h () =
|
|
~semicolon:false
|
|
name style;
|
|
pr " { abort (); } \\\n"
|
|
+ | { impl = OCaml _ } ->
|
|
+ (* Don't need to generate anything for OCaml functions since
|
|
+ * the caml-stubs do_* function will still exist.
|
|
+ *)
|
|
+ ()
|
|
) fns;
|
|
pr " int optgroup_%s_available (void) { return 0; }\n" group;
|
|
pr "\n"
|
|
--
|
|
2.47.3
|
|
|