From 4048f282c9f9b920aabb577d159db7938cc91fbe Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 2 Jan 2006 17:37:53 +0000 Subject: [PATCH] add to %argument_fail git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8185 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/argcargv.i | 2 +- Lib/typemaps/cstrings.swg | 10 ++++----- Lib/typemaps/enumint.swg | 2 +- Lib/typemaps/exception.swg | 14 ++++++------- Lib/typemaps/inoutlist.swg | 10 ++++----- Lib/typemaps/primtypes.swg | 38 ++++++++++++++++------------------- Lib/typemaps/ptrtypes.swg | 6 +++--- Lib/typemaps/strings.swg | 16 +++++++-------- Lib/typemaps/swigtype.swg | 32 ++++++++++++++--------------- Lib/typemaps/swigtypemaps.swg | 10 ++++----- Lib/typemaps/valtypes.swg | 4 ++-- Lib/typemaps/void.swg | 4 ++-- 12 files changed, 72 insertions(+), 76 deletions(-) diff --git a/Lib/python/argcargv.i b/Lib/python/argcargv.i index ae259d8d1..446bff031 100644 --- a/Lib/python/argcargv.i +++ b/Lib/python/argcargv.i @@ -57,7 +57,7 @@ SWIG_AsArgcArgv(PyObject* input, argv = SWIG_AsArgcArgv($input, $descriptor(char**), &argc, &owner); if (!argv) { $1 = 0; $2 = 0; - %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $argnum); + %argument_fail(SWIG_TypeError, "int ARGC, char **ARGV", $symname, $argnum); } else { $1 = ($1_ltype) argc; $2 = ($2_ltype) argv; diff --git a/Lib/typemaps/cstrings.swg b/Lib/typemaps/cstrings.swg index 06d619063..cc06b4d34 100644 --- a/Lib/typemaps/cstrings.swg +++ b/Lib/typemaps/cstrings.swg @@ -32,7 +32,7 @@ %typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) (TYPEMAP, SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) { - %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum); + %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $symname, $argnum); } $1 = ($1_ltype) buf; $2 = ($2_ltype) size - 1; @@ -115,7 +115,7 @@ %typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) TYPEMAP (Char temp[MAX+1], Char *t = 0, size_t n = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &t, &n, &alloc)))) { - %argument_fail(SWIG_TypeError, "TYPEMAP", $argnum); + %argument_fail(SWIG_TypeError, "TYPEMAP", $symname, $argnum); } if ( n > (size_t) MAX ) n = (size_t) MAX; memcpy(temp, t, sizeof(Char)*n); @@ -154,7 +154,7 @@ expansion += EXP; #endif if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &t, &n, &alloc)))) { - %argument_fail(SWIG_TypeError, "TYPEMAP", $argnum); + %argument_fail(SWIG_TypeError, "TYPEMAP", $symname, $argnum); } $1 = %new_array(n+expansion, $*1_ltype); memcpy($1,t,sizeof(Char)*n); @@ -183,7 +183,7 @@ %define Name ## _output_maxsize(TYPEMAP, SIZE) %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (size_t size, Char *buff = 0) { if (!SWIG_IsOK((SWIG_AsVal(size_t)($input, &size)))) { - %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum); + %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $symname, $argnum); } buff= %new_array(size+1, Char); $2 = %numeric_cast(size, $2_ltype); @@ -213,7 +213,7 @@ %define Name ## _output_withsize(TYPEMAP, SIZE) %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (size_t n, Char *buff = 0, $*2_ltype size) { if (!SWIG_IsOK((SWIG_AsVal(size_t)($input, &n)))) { - %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $argnum); + %argument_fail(SWIG_TypeError, "(TYPEMAP, SIZE)", $symname, $argnum); } buff= %new_array(n+1, Char); $1 = %static_cast(buff, $1_ltype); diff --git a/Lib/typemaps/enumint.swg b/Lib/typemaps/enumint.swg index a41b43cf5..854d6f3e1 100644 --- a/Lib/typemaps/enumint.swg +++ b/Lib/typemaps/enumint.swg @@ -8,7 +8,7 @@ %typemap(in,fragment=SWIG_AsVal_frag(int),noblock=1) const enum SWIGTYPE& (int val, int ecode, $basetype temp) { ecode = SWIG_AsVal(int)($input, &val); if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$type", $argnum); + %argument_fail(ecode, "$type", $symname, $argnum); } else { temp = %static_cast(val,$basetype); $1 = &temp; diff --git a/Lib/typemaps/exception.swg b/Lib/typemaps/exception.swg index c7b6b1c23..cc8b1e6ad 100644 --- a/Lib/typemaps/exception.swg +++ b/Lib/typemaps/exception.swg @@ -3,13 +3,13 @@ /* macros for error manipulation */ -#define %nullref_fmt() "invalid null reference " -#define %varfail_fmt(_type,_name) "in variable '"_name"' of type '"_type"'" -#define %argfail_fmt(_type,_argn) "in argument " #_argn" of type '" _type"'" -#define %outfail_fmt(_type) "in output value of type '"_type"'" -#define %argnullref_fmt(_type, _argn) %nullref_fmt() %argfail_fmt(_type, _argn) -#define %varnullref_fmt(_type, _name) %nullref_fmt() %varfail_fmt(_type, _name) -#define %outnullref_fmt(_type) %nullref_fmt() %outfail_fmt(_type) +#define %nullref_fmt() "invalid null reference " +#define %varfail_fmt(_type,_name) "in variable '"`_name`"' of type '"`_type`"'" +#define %argfail_fmt(_type,_name,_argn) "in method '" `_name` "', argument " `_argn`" of type '" `_type`"'" +#define %outfail_fmt(_type) "in output value of type '"_type"'" +#define %argnullref_fmt(_type,_name,_argn) %nullref_fmt() %argfail_fmt(_type, _name, _argn) +#define %varnullref_fmt(_type,_name) %nullref_fmt() %varfail_fmt(_type, _name) +#define %outnullref_fmt(_type) %nullref_fmt() %outfail_fmt(_type) /* setting an error */ #define %error(code,msg...) SWIG_Error(code, msg) diff --git a/Lib/typemaps/inoutlist.swg b/Lib/typemaps/inoutlist.swg index e15907309..da43f5e3a 100644 --- a/Lib/typemaps/inoutlist.swg +++ b/Lib/typemaps/inoutlist.swg @@ -82,7 +82,7 @@ or you can use the %apply directive : Type val; int ecode = asval_meth($input, &val); if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$*ltype",$argnum); + %argument_fail(ecode, "$*ltype",$symname, $argnum); } temp = %static_cast(val, $*ltype); $1 = &temp; @@ -94,7 +94,7 @@ or you can use the %apply directive : Type val; int ecode = asval_meth($input, &val); if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$*ltype",$argnum); + %argument_fail(ecode, "$*ltype",$symname, $argnum); } temp = %static_cast(val, $*ltype); $1 = &temp; @@ -118,17 +118,17 @@ or you can use the %apply directive : %typemap(in,noblock=1,fragment=asptr_frag) Type *INPUT(int res) { res = asptr_meth($input, &$1); if (!SWIG_IsOK(res)) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } res = SWIG_AddTmpMask(res); } %typemap(in,noblock=1,fragment=asptr_frag) Type &INPUT(int res) { res = asptr_meth($input, &$1); if (!SWIG_IsOK(res)) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } if (!$1) { - %argument_nullref("$type",$argnum); + %argument_nullref("$type",$symname, $argnum); } res = SWIG_AddTmpMask(res); } diff --git a/Lib/typemaps/primtypes.swg b/Lib/typemaps/primtypes.swg index 8793adcc2..82470bb4a 100644 --- a/Lib/typemaps/primtypes.swg +++ b/Lib/typemaps/primtypes.swg @@ -205,27 +205,23 @@ SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; if (min <= x && x <= max) { -%#ifdef SWIG_HAS_NO_RINT - /* Use the python mechanism to round, or so */ - double rd = (x < 0) ? ceil(x) : floor(x); -%#else - double rd = rint(x); -%#endif - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - if (rd == x) { - return 1; - } else { - double diff = rd - x; - double summ = rd + x; - double reps = diff/summ; - if (fabs(reps) < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } + double fx = floor(x); + double rd = ((x - fx) < 0.5) ? fx : ceil(x); /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + if (rd == x) { + return 1; + } else { + double diff = rd - x; + double summ = rd + x; + double reps = diff/summ; + if (fabs(reps) < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } } return 0; } diff --git a/Lib/typemaps/ptrtypes.swg b/Lib/typemaps/ptrtypes.swg index 54e684c57..6e9c6f06a 100644 --- a/Lib/typemaps/ptrtypes.swg +++ b/Lib/typemaps/ptrtypes.swg @@ -28,7 +28,7 @@ %typemap(in,fragment=frag) Type { Type *ptr = (Type *)0; int res = asptr_meth($input, &ptr); - if (!SWIG_IsOK(res) || !ptr) { %argument_fail(SWIG_TypeError, "$type", $argnum); } + if (!SWIG_IsOK(res) || !ptr) { %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } $1 = *ptr; if (SWIG_IsNewObj(res)) %delete(ptr); } @@ -36,8 +36,8 @@ %typemap(in,fragment=frag) const Type & (int res = SWIG_OLDOBJ) { Type *ptr = (Type *)0; res = asptr_meth($input, &ptr); - if (!SWIG_IsOK(res)) { %argument_fail(SWIG_TypeError,"$type",$argnum); } - if (!ptr) { %argument_nullref("$type",$argnum); } + if (!SWIG_IsOK(res)) { %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } + if (!ptr) { %argument_nullref("$type",$symname, $argnum); } $1 = ptr; } %typemap(freearg,noblock=1) const Type & { diff --git a/Lib/typemaps/strings.swg b/Lib/typemaps/strings.swg index 7ff0f1688..c288d81bd 100644 --- a/Lib/typemaps/strings.swg +++ b/Lib/typemaps/strings.swg @@ -31,7 +31,7 @@ Char * (Char *buf = 0, int alloc = 0), const Char * (Char *buf = 0, int alloc = 0) { if (!SWIG_IsOK(SWIG_AsCharPtr($input, &buf, &alloc))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = buf; } @@ -41,7 +41,7 @@ %typemap(in,noblock=1,fragment=#SWIG_AsCharPtr) Char const*& (Char *buf = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtr($input, &buf, &alloc)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = &temp; } @@ -250,7 +250,7 @@ const Char [ANY](Char temp[$1_dim0]) { if (!SWIG_IsOK((SWIG_AsCharArray($input, temp, $1_dim0)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = temp; } @@ -259,7 +259,7 @@ %typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0]) { if (!SWIG_IsOK((SWIG_AsCharArray($input, temp, $1_dim0)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = &temp; } @@ -398,7 +398,7 @@ (const Char *STRING, size_t LENGTH) (Char *buf = 0, size_t size = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = %static_cast(buf, $1_ltype); $2 = %numeric_cast(size - 1, $2_ltype); @@ -417,7 +417,7 @@ (const Char *STRING, size_t SIZE) (Char *buf = 0, size_t size = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $1 = %static_cast(buf, $1_ltype); $2 = %numeric_cast(size, $2_ltype); @@ -438,7 +438,7 @@ (size_t LENGHT, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } $2 = %static_cast(buf, $2_ltype) ; $1 = %numeric_cast(size - 1, $1_ltype) ; @@ -456,7 +456,7 @@ (size_t SIZE, const Char *STRING) (Char *buf = 0, size_t size = 0, int alloc = 0) { if (!SWIG_IsOK((SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc)))) { - %argument_fail(SWIG_TypeError, "$type",$argnum); + %argument_fail(SWIG_TypeError, "$type",$symname, $argnum); } $2 = %static_cast(buf, $2_ltype) ; $1 = %numeric_cast(size, $1_ltype) ; diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index 3d34f7e4f..55f55620e 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -5,7 +5,7 @@ /* Pointers and arrays */ %typemap(in, noblock=1) SWIGTYPE *(void *argp = 0) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } $1 = %reinterpret_cast(argp, $ltype); } @@ -13,7 +13,7 @@ %typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } $1 = %reinterpret_cast(argp, $ltype); } @@ -22,7 +22,7 @@ %typemap(in, noblock=1) SWIGTYPE* const& (void *argp = 0, $*ltype temp) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$*ltype", $argnum); + %argument_fail(SWIG_TypeError, "$*ltype", $symname, $argnum); } temp = %reinterpret_cast(argp, $*ltype); $1 = &temp; @@ -33,9 +33,9 @@ /* Reference */ %typemap(in, noblock=1) SWIGTYPE & (void *argp = 0) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } - if (!argp) { %argument_nullref("$type", $argnum); } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg) SWIGTYPE & ""; @@ -44,9 +44,9 @@ %typemap(in,implicitconv=1) const SWIGTYPE & (void *argp = 0, int res) { res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags | %implicitconv_flag); if (!SWIG_IsOK(res)) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } - if (!argp) { %argument_nullref("$type", $argnum); } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } $1 = %reinterpret_cast(argp, $ltype); } %typemap(freearg,noblock=1,match="in",implicitconv=1) const SWIGTYPE & @@ -56,9 +56,9 @@ #else %typemap(in,noblock=1) const SWIGTYPE & (void *argp) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } - if (!argp) { %argument_nullref("$type", $argnum); } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } $1 = %reinterpret_cast(argp, $ltype); } #endif @@ -69,10 +69,10 @@ void *argp; int res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags | %implicitconv_flag); if (!SWIG_IsOK(res)) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } if (!argp) { - %argument_nullref("$type", $argnum); + %argument_nullref("$type", $symname, $argnum); } else { $<ype temp = %reinterpret_cast(argp, $<ype); $1 = *temp; @@ -84,10 +84,10 @@ void *argp; $<ype temp; if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } if (!argp) { - %argument_nullref("$type", $argnum); + %argument_nullref("$type", $symname, $argnum); } else { $1 = *(%reinterpret_cast(argp, $<ype)); } @@ -451,7 +451,7 @@ %typemap(in,noblock=1) SWIGTYPE (CLASS::*) { if (!SWIG_IsOK((SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } } @@ -502,7 +502,7 @@ */ %typemap(in, noblock=1) SWIGTYPE ((*)(ANY)) { if (!SWIG_IsOK((SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor)))) { - %argument_fail(SWIG_TypeError,"$type",$argnum); + %argument_fail(SWIG_TypeError,"$type",$symname, $argnum); } } @@ -562,7 +562,7 @@ %typemap(in, noblock=1) SWIGTYPE *DISOWN { if (!SWIG_IsOK((SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags)))) { - %argument_fail(SWIG_TypeError,"$type", $argnum); + %argument_fail(SWIG_TypeError,"$type", $symname, $argnum); } } diff --git a/Lib/typemaps/swigtypemaps.swg b/Lib/typemaps/swigtypemaps.swg index af1c7768f..036bc3263 100644 --- a/Lib/typemaps/swigtypemaps.swg +++ b/Lib/typemaps/swigtypemaps.swg @@ -131,11 +131,11 @@ * Language independent definitions * ----------------------------------------------------------------------------- */ -#define %error_block(Block...) %block(Block) -#define %argument_fail(code, type, argn) SWIG_exception(code, %argfail_fmt(type, argn)) -#define %argument_nullref(type, argn) SWIG_exception(SWIG_ValueError, %argnullref_fmt(type, argn)) -#define %variable_fail(code, type, name) SWIG_exception(code, %varfail_fmt(type, name)) -#define %variable_nullref(type, name) SWIG_exception(SWIG_ValueError, %varnullref_fmt(type, name)) +#define %error_block(Block...) %block(Block) +#define %argument_fail(code, type, name, argn) SWIG_exception(code, %argfail_fmt(type, name, argn)) +#define %argument_nullref(type, name, argn) SWIG_exception(SWIG_ValueError, %argnullref_fmt(type, name, argn)) +#define %variable_fail(code, type, name) SWIG_exception(code, %varfail_fmt(type, name)) +#define %variable_nullref(type, name) SWIG_exception(SWIG_ValueError, %varnullref_fmt(type, name)) #if defined(SWIG_DIRECTOR_TYPEMAPS) #define %dirout_fail(code, type) SWIG_DirOutFail(code, %outfail_fmt(type)) diff --git a/Lib/typemaps/valtypes.swg b/Lib/typemaps/valtypes.swg index 20af63fb4..9bf3136c2 100644 --- a/Lib/typemaps/valtypes.swg +++ b/Lib/typemaps/valtypes.swg @@ -34,7 +34,7 @@ %typemap(in,noblock=1,fragment=frag) Type (Type val, int ecode = 0) { ecode = asval_meth($input, &val); if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$ltype", $argnum); + %argument_fail(ecode, "$ltype", $symname, $argnum); } $1 = %static_cast(val,$ltype); } @@ -42,7 +42,7 @@ %typemap(in,noblock=1,fragment=frag) const Type & ($*ltype temp, Type val, int ecode = 0) { ecode = asval_meth($input, &val); if (!SWIG_IsOK(ecode)) { - %argument_fail(ecode, "$*ltype", $argnum); + %argument_fail(ecode, "$*ltype", $symname, $argnum); } temp = %static_cast(val, $*ltype); $1 = &temp; diff --git a/Lib/typemaps/void.swg b/Lib/typemaps/void.swg index 0107cc832..fcfe4ad3b 100644 --- a/Lib/typemaps/void.swg +++ b/Lib/typemaps/void.swg @@ -6,14 +6,14 @@ %typemap(in,noblock=1) void * { if (!SWIG_IsOK((SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown)))) { - %argument_fail(SWIG_TypeError, "$type", $argnum); + %argument_fail(SWIG_TypeError, "$type", $symname, $argnum); } } %typemap(freearg) void * ""; %typemap(in,noblock=1) void * const& ($*ltype temp) { if (!SWIG_IsOK((SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown)))) { - %argument_fail(SWIG_TypeError, "Stype", $argnum); + %argument_fail(SWIG_TypeError, "Stype", $symname, $argnum); } $1 = &temp; }