X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator%2Fgenerator.ml;h=230b66bb11add532722be8c3da93fa1c7a6ef87d;hb=97c3cd728eaa608ceb9c0f2db20a002b6dcccf02;hp=1131f5426170ccf10705152a176e78a3fc61590c;hpb=c8ff937827f1321052c9b4e843fae9a3e0776916;p=hivex.git diff --git a/generator/generator.ml b/generator/generator.ml index 1131f54..230b66b 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -1493,7 +1493,29 @@ and generate_ocaml_c () = #include #include #include + +#ifdef HAVE_CAML_UNIXSUPPORT_H #include +#else +extern value unix_error_of_code (int errcode); +#endif + +#ifndef HAVE_CAML_RAISE_WITH_ARGS +static void +caml_raise_with_args (value tag, int nargs, value args[]) +{ + CAMLparam1 (tag); + CAMLxparamN (args, nargs); + value bucket; + int i; + + bucket = caml_alloc_small (1 + nargs, 0); + Field(bucket, 0) = tag; + for (i = 0; i < nargs; i++) Field(bucket, 1 + i) = args[i]; + caml_raise(bucket); + CAMLnoreturn; +} +#endif #include @@ -1901,7 +1923,7 @@ XSLoader::load ('Win::Hivex'); =item open - $h = Win::Hivex::open ($filename,"; + $h = Win::Hivex->open ($filename,"; List.iter ( fun (_, flag, _) -> @@ -2393,7 +2415,7 @@ DESTROY (h) pr " size_t len;\n"; pr " hive_type type;\n"; pr " PPCODE:\n"; - pr " r = hivex_%s (%s, &len, &type);\n" + pr " r = hivex_%s (%s, &type, &len);\n" name (String.concat ", " c_params); free_args (); pr " if (r == -1)\n"; @@ -2409,7 +2431,7 @@ DESTROY (h) pr " size_t len;\n"; pr " hive_type type;\n"; pr " PPCODE:\n"; - pr " r = hivex_%s (%s, &len, &type);\n" + pr " r = hivex_%s (%s, &type, &len);\n" name (String.concat ", " c_params); free_args (); pr " if (r == NULL)\n";