From 1538bc2831934f236640dea6ba907342930bb489 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 11 Feb 2003 21:24:40 +0000 Subject: [PATCH] SWIGTYPE & varin typemap fix git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4293 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/ruby.swg | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Lib/ruby/ruby.swg b/Lib/ruby/ruby.swg index bb4dd1136..952a80da4 100644 --- a/Lib/ruby/ruby.swg +++ b/Lib/ruby/ruby.swg @@ -266,9 +266,14 @@ /* Typemaps for pointers. Note: the SWIG run-time type checker works even if a pointer happens to be mapped to a Ruby class */ -%typemap(varin) SWIGTYPE *, - SWIGTYPE & - "SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);" +%typemap(varin) SWIGTYPE * + "SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, 1);" + +%typemap(varin) SWIGTYPE & { + void *temp; + SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor, 1); + $1 = *($1_ltype) temp; +} %typemap(varin) SWIGTYPE [] { rb_raise(rb_eRuntimeError, "Array $name is readonly");