fix non public overload order

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6770 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-11-28 09:15:58 +00:00
commit c4d6cdf0ab
3 changed files with 45 additions and 3 deletions

View file

@ -524,6 +524,17 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
* for namespace support, type resolution, and other issues.
* ----------------------------------------------------------------------------- */
static Node*
symbol_head(Node *n)
{
Node *pn = Getattr(n, "sym:previousSibling");
while (pn) {
n = pn;
pn = Getattr(n, "sym:previousSibling");
}
return n;
}
Node *
Swig_symbol_add(String_or_char *symname, Node *n) {
Hash *c, *cn, *cl = 0;
@ -710,10 +721,18 @@ Swig_symbol_add(String_or_char *symname, Node *n) {
assert(!Getattr(n,"sym:overname"));
Setattr(n,"sym:overname", NewStringf("__SWIG_%d", pn));
/*Printf(stdout,"%s %s %s\n", symname, Getattr(n,"decl"), Getattr(n,"sym:overname")); */
Setattr(cl,"sym:nextSibling",n);
Setattr(n,"sym:previousSibling",cl);
if (Getattr(n,"access")) {
/* add the protected/private members at the top of the overload list*/
Node *hl = symbol_head(cl);
Setattr(n,"sym:nextSibling",hl);
Setattr(hl,"sym:previousSibling",n);
} else {
Setattr(cl,"sym:nextSibling",n);
Setattr(n,"sym:previousSibling",cl);
}
Setattr(cl,"sym:overloaded",c);
Setattr(n,"sym:overloaded",c);
return n;
}