[OCaml] Fix the char_binary test for OCaml
Add %typemap(in) (char *STRING, size_t LENGTH). Fix warnings in char_binary.i. ./../char_binary.i:7: Warning 453: Can't apply (char *STRING,size_t LENGTH). No typemaps are defined. ./../char_binary.i:8: Warning 453: Can't apply (char *STRING,size_t LENGTH). No typemaps are defined. Add a runtime test (it is based on the Python and Go char_binary runtime tests).
This commit is contained in:
parent
7118e4ef1e
commit
85860c0a61
2 changed files with 28 additions and 0 deletions
|
|
@ -353,6 +353,10 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
|
|||
%swig_enum_out(varout)
|
||||
%swig_enum_out(directorin)
|
||||
|
||||
%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) {
|
||||
$1 = ($1_ltype) caml_string_val($input);
|
||||
$2 = ($2_ltype) caml_string_len($input);
|
||||
}
|
||||
|
||||
/* Array reference typemaps */
|
||||
%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue