File 001-Avoid-not-available-macro-for-OCaml-functions.patch of Package libguestfs

Subject: generator/daemon.ml: Avoid not available macro for OCaml functions
From: Richard W.M. Jones rjones@redhat.com Mon Jan 19 21:36:08 2026 +0000
Date: Tue Jan 20 12:15:55 2026 +0000:
Git: 07ea5915766d829b62255fb2a94239a28f433159

Reported-by: Toolybird
Fixes: https://github.com/libguestfs/libguestfs/issues/290
(cherry picked from commit 1b79e22be443b48dc2bdb518cfea14342b3d8136)

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"
openSUSE Build Service is sponsored by