From 2fdbd8679fe4d7545e0eaaf111fc84aeadae26af Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 1 Dec 2004 01:18:56 +0000 Subject: [PATCH] fix enum + ref + directors git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6815 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/ruby/rubyenum.swg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SWIG/Lib/ruby/rubyenum.swg b/SWIG/Lib/ruby/rubyenum.swg index 0aa371e15..abce97cbc 100644 --- a/SWIG/Lib/ruby/rubyenum.swg +++ b/SWIG/Lib/ruby/rubyenum.swg @@ -10,7 +10,11 @@ $1 = &temp;"; -%typemap(directorout) enum SWIGTYPE "$result = NUM2INT($input);"; +%typemap(directorout) enum SWIGTYPE "$result = ($1_ltype) NUM2INT($input);"; +%typemap(directorout) const enum SWIGTYPE & ($*1_ltype temp) + "temp = ($*1_ltype) NUM2INT($input); + $result = &temp;"; + /* --- Output typemaps --- */ %typemap(out) enum SWIGTYPE "$result = INT2NUM($1);"; @@ -18,6 +22,7 @@ %typemap(out) const enum SWIGTYPE & "$result = INT2NUM((long) *($1));"; %typemap(directorin) enum SWIGTYPE "$input = INT2NUM($1);"; +%typemap(directorin) const enum SWIGTYPE& "$input = INT2NUM($1);"; /* --- Variable Input --- */