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;