[OCaml] Fix director_pass_by_value

Add a directorin typemap for SWIGTYPE.

Add director_frob_runme.ml, director_pass_by_value_runme.ml, and
director_unroll_runme.ml.

This commit fixes most of the director-related warnings in the OCaml
test suite. Of the director tests that are currently included in the
OCaml test suite, director_basic and director_property are the only
ones which give warnings (due to issues with typecheck typemaps).
This commit is contained in:
Zackery Spytz 2019-02-04 11:29:54 -07:00
commit 9942e6a582
5 changed files with 59 additions and 1 deletions

View file

@ -109,6 +109,17 @@
#endif
%typemap(directorin) SWIGTYPE {
$&ltype temp = new $ltype((const $ltype &)$1);
swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor);
args = caml_list_append(args, swig_result);
}
%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && {
swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor);
args = caml_list_append(args, swig_result);
}
/* The SIMPLE_MAP macro below defines the whole set of typemaps needed
for simple types. */