ocaml: Get rid of CAMLprim.

It's wrong to use it, and in any case it doesn't do anything on Linux.
This commit is contained in:
Richard W.M. Jones
2012-10-15 22:38:16 +01:00
parent 8a89c72821
commit 3d46f7dc03
2 changed files with 16 additions and 16 deletions

View File

@@ -327,7 +327,7 @@ and generate_ocaml_c () =
* the list in reverse order, but hashtables aren't supposed to be
* ordered anyway.
*/
static CAMLprim value
static value
copy_table (char * const * argv)
{
CAMLparam0 ();
@@ -355,7 +355,7 @@ copy_table (char * const * argv)
(* Struct copy functions. *)
let emit_ocaml_copy_list_function typ =
pr "static CAMLprim value\n";
pr "static value\n";
pr "copy_%s_list (const struct guestfs_%s_list *%ss)\n" typ typ typ;
pr "{\n";
pr " CAMLparam0 ();\n";
@@ -381,7 +381,7 @@ copy_table (char * const * argv)
let has_optpercent_col =
List.exists (function (_, FOptPercent) -> true | _ -> false) cols in
pr "static CAMLprim value\n";
pr "static value\n";
pr "copy_%s (const struct guestfs_%s *%s)\n" typ typ typ;
pr "{\n";
pr " CAMLparam0 ();\n";
@@ -452,11 +452,11 @@ copy_table (char * const * argv)
match ret 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);
pr "value ocaml_guestfs_%s (value %s" name (List.hd params);
List.iter (pr ", value %s") (List.tl params); pr ");\n";
pr "\n";
pr "CAMLprim value\n";
pr "value\n";
pr "ocaml_guestfs_%s (value %s" name (List.hd params);
List.iter (pr ", value %s") (List.tl params);
pr ")\n";
@@ -653,9 +653,9 @@ copy_table (char * const * argv)
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 "value ocaml_guestfs_%s_byte (value *argv, int argn);\n" name;
pr "\n";
pr "value\n";
pr "ocaml_guestfs_%s_byte (value *argv, int argn ATTRIBUTE_UNUSED)\n"
name;
pr "{\n";

View File

@@ -48,10 +48,10 @@ static void event_callback_wrapper (guestfs_h *g, void *data, uint64_t event, in
#endif
/* These prototypes are solely to quiet gcc warning. */
CAMLprim value ocaml_guestfs_create (value environmentv, value close_on_exitv, value unitv);
CAMLprim value ocaml_guestfs_close (value gv);
CAMLprim value ocaml_guestfs_set_event_callback (value gv, value closure, value events);
CAMLprim value ocaml_guestfs_delete_event_callback (value gv, value eh);
value ocaml_guestfs_create (value environmentv, value close_on_exitv, value unitv);
value ocaml_guestfs_close (value gv);
value ocaml_guestfs_set_event_callback (value gv, value closure, value events);
value ocaml_guestfs_delete_event_callback (value gv, value eh);
value ocaml_guestfs_last_errno (value gv);
value ocaml_guestfs_user_cancel (value gv);
@@ -140,7 +140,7 @@ ocaml_guestfs_raise_closed (const char *func)
}
/* Guestfs.create */
CAMLprim value
value
ocaml_guestfs_create (value environmentv, value close_on_exitv, value unitv)
{
CAMLparam3 (environmentv, close_on_exitv, unitv);
@@ -180,7 +180,7 @@ ocaml_guestfs_create (value environmentv, value close_on_exitv, value unitv)
}
/* Guestfs.close */
CAMLprim value
value
ocaml_guestfs_close (value gv)
{
CAMLparam1 (gv);
@@ -234,7 +234,7 @@ event_bitmask_of_event_list (value events)
}
/* Guestfs.set_event_callback */
CAMLprim value
value
ocaml_guestfs_set_event_callback (value gv, value closure, value events)
{
CAMLparam3 (gv, closure, events);
@@ -269,7 +269,7 @@ ocaml_guestfs_set_event_callback (value gv, value closure, value events)
}
/* Guestfs.delete_event_callback */
CAMLprim value
value
ocaml_guestfs_delete_event_callback (value gv, value ehv)
{
CAMLparam2 (gv, ehv);