[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:
parent
6f4adde4b4
commit
9f74955e8d
1 changed files with 1 additions and 1 deletions
|
|
@ -369,7 +369,7 @@ extern "C" {
|
||||||
if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
|
if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
|
||||||
vv = caml_swig_alloc(1,C_string);
|
vv = caml_swig_alloc(1,C_string);
|
||||||
SWIG_Store_field(vv,0,caml_alloc_string(len));
|
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);
|
CAMLreturn(vv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue