* src/generator.ml: Emit prototypes for ocaml_guestfs_* functions,
to avoid warnings from gcc -Wmissing-prototypes. Normally we'd put
these somewhere else, but in this unusual case, they're not needed
anywhere else. Handle the >5-argument case, too, for these:
ocaml_guestfs_test0_byte, ocaml_guestfs_sfdisk_byte,
ocaml_guestfs_sfdisk_N_byte.
let needs_extra_vs =
match fst style with RConstOptString _ -> true | _ -> false in
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ocaml_guestfs_%s (value %s" name (List.hd params);
+ List.iter (pr ", value %s") (List.tl params); pr ");\n";
+
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s (value %s" name (List.hd params);
List.iter (pr ", value %s") (List.tl params);
pr "\n";
if List.length params > 5 then (
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ";
+ pr "ocaml_guestfs_%s_byte (value *argv, int argn);\n" name;
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s_byte (value *argv, int argn)\n" name;
pr "{\n";