changes to support cast ranking for dispatch and/or overloading

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8044 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-23 00:06:27 +00:00
commit ae09b70a40
13 changed files with 63 additions and 42 deletions

View file

@ -7,7 +7,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 (ecode != SWIG_OK) {
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $argnum);
} else {
temp = %static_cast(val,$basetype);
@ -21,7 +21,7 @@
%variable_fail(SWIG_AttributeError,"$type", "arch, read-only $name");
} else {
int ecode = SWIG_AsVal(int)($input, %reinterpret_cast(&$1,int*));
if (ecode != SWIG_OK) {
if (!SWIG_IsOK(ecode)) {
%variable_fail(ecode, "$type", "$name");
}
}