%apply also looks for a typedef match if it doesn't find a match at first

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6509 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-10-26 00:30:05 +00:00
commit f5adbd3f6f

View file

@ -396,6 +396,21 @@ Swig_typemap_apply(ParmList *src, ParmList *dest) {
/* See if there is a matching typemap in this scope */
sm = Swig_typemap_get(type,name,ts);
/* if there is not matching, look for a typemap in the
original typedef, if any, like in:
typedef unsigned long size_t;
...
%apply(size_t) {my_size}; ==> %apply(unsigned long) {my_size};
*/
if (!sm) {
SwigType *ntype = SwigType_typedef_resolve(type);
if (Cmp(ntype,type) != 0) {
sm = Swig_typemap_get(ntype,name,ts);
}
Delete(ntype);
}
if (sm) {
/* Got a typemap. Need to only merge attributes for methods that match our signature */
Iterator ki;