[Ocaml] Fix to work with CAML_SAFE_STRING

CAML_SAFE_STRING is on by default in current Ocaml versions, and was
stopping SWIG-generated wrappers from compiling.

Fixes #2083
This commit is contained in:
Olly Betts 2022-02-01 13:29:53 +13:00
commit 9f74955e8d

View file

@ -369,7 +369,7 @@ extern "C" {
if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
vv = caml_swig_alloc(1,C_string);
SWIG_Store_field(vv,0,caml_alloc_string(len));
memcpy(String_val(SWIG_Field(vv,0)),p,len);
memcpy(Bp_val(SWIG_Field(vv,0)),p,len);
CAMLreturn(vv);
}