diff options
author | Zackery Spytz <zspytz@gmail.com> | 2019-02-14 02:21:36 -0700 |
---|---|---|
committer | Zackery Spytz <zspytz@gmail.com> | 2019-02-14 02:21:36 -0700 |
commit | a159a252dd98e50f91c835201acbb82941d5e4e4 (patch) | |
tree | 5c5a1b2217af59b7d02897c3a2ec11ca43796b8f /Lib/ocaml | |
parent | 200984f0512627ffb48cbd6bcbaf2e0604fcc172 (diff) | |
download | swig-a159a252dd98e50f91c835201acbb82941d5e4e4.tar.gz |
[OCaml] Fix the dynamic_cast test
Add out typemaps for SWIGTYPE *DYNAMIC and SWIGTYPE &DYNAMIC.
Add dynamic_cast_runme.ml.
Diffstat (limited to 'Lib/ocaml')
-rw-r--r-- | Lib/ocaml/typemaps.i | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/ocaml/typemaps.i b/Lib/ocaml/typemaps.i index 4475707d6..a781838ca 100644 --- a/Lib/ocaml/typemaps.i +++ b/Lib/ocaml/typemaps.i @@ -307,6 +307,11 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val); $2 = ($2_ltype) caml_string_len($input); } +%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { + swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1); + $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty); +} + /* Array reference typemaps */ %apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } %apply SWIGTYPE && { SWIGTYPE ((&)[ANY]) } |