perl_c.c: Fix declaration of argv
[perl4caml.git] / perl_c.c
index 66f2959..83f9332 100644 (file)
--- a/perl_c.c
+++ b/perl_c.c
@@ -94,7 +94,7 @@ perl4caml_init (value unit)
   int argc = 4;
   static char *argv[] = { "", "-w", "-e", "0", NULL };
 
-  PERL_SYS_INIT (&argc, &argv);
+  PERL_SYS_INIT (&argc, (char ***) &argv);
   my_perl = perl_alloc ();
   perl_construct (my_perl);
   PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
@@ -719,11 +719,13 @@ perl4caml_get_hv (value optcreate, value name)
 static inline void
 check_perl_failure ()
 {
+  CAMLparam0 ();
+  CAMLlocal1 (errv);
+
   SV *errsv = get_sv ("@", TRUE);
 
   if (SvTRUE (errsv))          /* Equivalent of $@ in Perl. */
     {
-      CAMLlocal1 (errv);
       STRLEN n_a;
       const char *err = SvPV (errsv, n_a);
 
@@ -731,6 +733,8 @@ check_perl_failure ()
 
       caml_raise_with_arg (*caml_named_value ("perl4caml_perl_failure"), errv);
     }
+
+  CAMLreturn0;
 }
 
 CAMLprim value