reduce the typedef reduce cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8924 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
357d0650ed
commit
05a5ec5e54
2 changed files with 21 additions and 8 deletions
|
|
@ -2530,8 +2530,12 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
|
|||
if (!value) {
|
||||
SwigType *ty = Getattr(p,k_type);
|
||||
if (ty) {
|
||||
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
||||
int reduce = template_reduce || SwigType_ispointer(rty) || SwigType_isarray(rty) || SwigType_isreference(rty);
|
||||
SwigType *rty = 0;
|
||||
int reduce = template_reduce;
|
||||
if (reduce || !SwigType_ispointer(ty)) {
|
||||
rty = Swig_symbol_typedef_reduce(ty,tscope);
|
||||
if (!reduce) reduce = SwigType_ispointer(rty);
|
||||
}
|
||||
ty = reduce ? Swig_symbol_type_qualify(rty,tscope) : Swig_symbol_type_qualify(ty,tscope);
|
||||
Setattr(p,k_type,ty);
|
||||
Delete(ty);
|
||||
|
|
|
|||
|
|
@ -646,13 +646,22 @@ SwigType_ltype(SwigType *s) {
|
|||
}
|
||||
if (SwigType_issimple(tc)) {
|
||||
/* Resolve any typedef definitions */
|
||||
td = SwigType_typedef_resolve_all(tc);
|
||||
if (td && (SwigType_isconst(td) || SwigType_isarray(td) || SwigType_isreference(td))) {
|
||||
/* We need to use the typedef type */
|
||||
SwigType *tt = Copy(tc);
|
||||
td = 0;
|
||||
while ((td = SwigType_typedef_resolve(tt))) {
|
||||
if (td && (SwigType_isconst(td) || SwigType_isarray(td) || SwigType_isreference(td))) {
|
||||
/* We need to use the typedef type */
|
||||
Delete(tt);
|
||||
tt = td;
|
||||
break;
|
||||
} else if (td) {
|
||||
Delete(tt);
|
||||
tt = td;
|
||||
}
|
||||
}
|
||||
if (td) {
|
||||
Delete(tc);
|
||||
tc = td;
|
||||
} else if (td) {
|
||||
Delete(td);
|
||||
tc = td;
|
||||
}
|
||||
}
|
||||
elements = SwigType_split(tc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue