diff options
Diffstat (limited to 'Lib/perl5/perlrun.swg')
-rw-r--r-- | Lib/perl5/perlrun.swg | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Lib/perl5/perlrun.swg b/Lib/perl5/perlrun.swg index 54d098d9b..6fb2968f0 100644 --- a/Lib/perl5/perlrun.swg +++ b/Lib/perl5/perlrun.swg @@ -205,13 +205,32 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { } } +/* Identical to SWIG_TypeCheck, except for strcmp comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) - || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || + (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } - /* Function for getting a pointer value */ SWIGRUNTIME int |