From d70fd338befd5ce789f41fdf17f09f4b323940ae Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Fri, 6 Jun 2003 02:04:00 +0000 Subject: [PATCH] Four failed test cases remaining. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4866 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/ocaml/typemaps.i | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SWIG/Lib/ocaml/typemaps.i b/SWIG/Lib/ocaml/typemaps.i index 465689128..4961aa49e 100644 --- a/SWIG/Lib/ocaml/typemaps.i +++ b/SWIG/Lib/ocaml/typemaps.i @@ -34,10 +34,12 @@ #ifdef __cplusplus %typemap(in) SWIGTYPE & { + /* %typemap(in) SWIGTYPE & */ $1 = ($ltype) caml_ptr_val($input,$1_descriptor); } %typemap(out) SWIGTYPE & { + /* %typemap(out) SWIGTYPE & */ CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *) $1,$1_descriptor)); @@ -69,9 +71,9 @@ } %typemap(out) SWIGTYPE { - void *temp = new $ltype($1); + /* %typemap(out) SWIGTYPE */ + $&1_ltype temp = new $ltype(($1_ltype &) $1); CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - *(($ltype *)temp) = $1; if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); } else { @@ -86,9 +88,10 @@ } %typemap(out) SWIGTYPE { + /* %typemap(out) SWIGTYPE */ void *temp = calloc(1,sizeof($ltype)); CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); - *(($ltype *)temp) = $1; + memmove( temp, &$1, sizeof( $1_type ) ); if( fromval ) { $result = callback(*fromval,caml_val_ptr((void *)temp,$&1_descriptor)); } else {