From b40f47a7fd307ee18985fff76dfd1dd3cc3f3f2d Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 15 Nov 2004 20:55:53 +0000 Subject: [PATCH] more enum typemaps git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6730 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/pyenum.swg | 6 ++++++ SWIG/Lib/python/pyvaltypes.swg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SWIG/Lib/python/pyenum.swg b/SWIG/Lib/python/pyenum.swg index b08e26249..d95eebdf1 100644 --- a/SWIG/Lib/python/pyenum.swg +++ b/SWIG/Lib/python/pyenum.swg @@ -4,6 +4,12 @@ %apply int { enum SWIGTYPE }; %apply const int& { const enum SWIGTYPE& }; +%typemap(in,fragment=SWIG_As_frag(int)) const enum SWIGTYPE& ($basetype temp) { + temp = SWIG_static_cast(SWIG_As(int)($input),$basetype); + if (SWIG_arg_fail($argnum)) SWIG_fail; + $1 = &temp; +} + %typemap(varin,fragment=SWIG_AsVal_frag(int)) enum SWIGTYPE { diff --git a/SWIG/Lib/python/pyvaltypes.swg b/SWIG/Lib/python/pyvaltypes.swg index 93570a9ba..679024ff2 100644 --- a/SWIG/Lib/python/pyvaltypes.swg +++ b/SWIG/Lib/python/pyvaltypes.swg @@ -12,7 +12,7 @@ $1 = SWIG_static_cast(SWIG_arg(as_meth($input)),$type); if (SWIG_arg_fail($argnum)) SWIG_fail; } - %typemap(in,fragment=pyfrag) const Type & ($basetype temp) { + %typemap(in,fragment=pyfrag) const Type & ($*ltype temp) { temp = SWIG_static_cast(SWIG_arg(as_meth($input)),$basetype); if (SWIG_arg_fail($argnum)) SWIG_fail; $1 = &temp;