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) {
|
if (!value) {
|
||||||
SwigType *ty = Getattr(p,k_type);
|
SwigType *ty = Getattr(p,k_type);
|
||||||
if (ty) {
|
if (ty) {
|
||||||
SwigType *rty = Swig_symbol_typedef_reduce(ty,tscope);
|
SwigType *rty = 0;
|
||||||
int reduce = template_reduce || SwigType_ispointer(rty) || SwigType_isarray(rty) || SwigType_isreference(rty);
|
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);
|
ty = reduce ? Swig_symbol_type_qualify(rty,tscope) : Swig_symbol_type_qualify(ty,tscope);
|
||||||
Setattr(p,k_type,ty);
|
Setattr(p,k_type,ty);
|
||||||
Delete(ty);
|
Delete(ty);
|
||||||
|
|
|
||||||
|
|
@ -646,13 +646,22 @@ SwigType_ltype(SwigType *s) {
|
||||||
}
|
}
|
||||||
if (SwigType_issimple(tc)) {
|
if (SwigType_issimple(tc)) {
|
||||||
/* Resolve any typedef definitions */
|
/* Resolve any typedef definitions */
|
||||||
td = SwigType_typedef_resolve_all(tc);
|
SwigType *tt = Copy(tc);
|
||||||
if (td && (SwigType_isconst(td) || SwigType_isarray(td) || SwigType_isreference(td))) {
|
td = 0;
|
||||||
/* We need to use the typedef type */
|
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);
|
Delete(tc);
|
||||||
tc = td;
|
tc = td;
|
||||||
} else if (td) {
|
|
||||||
Delete(td);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elements = SwigType_split(tc);
|
elements = SwigType_split(tc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue