Fixed problem with typedef with -fvirtual
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4369 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
036a2ca079
commit
0c7fdcc867
1 changed files with 23 additions and 10 deletions
|
|
@ -36,31 +36,44 @@ class Allocate : public Dispatcher {
|
||||||
int function_is_defined_in_bases(Node *c, Node *bases) {
|
int function_is_defined_in_bases(Node *c, Node *bases) {
|
||||||
int i;
|
int i;
|
||||||
Node *b, *temp;
|
Node *b, *temp;
|
||||||
String *name, *type, *decl;
|
String *name, *type, *local_decl, *base_decl;
|
||||||
|
|
||||||
if (!bases)
|
if (!bases)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
name = Getattr(c, "name");
|
name = Getattr(c, "name");
|
||||||
type = Getattr(c, "type");
|
type = Getattr(c, "type");
|
||||||
decl = Getattr(c, "decl");
|
local_decl = Getattr(c, "decl");
|
||||||
|
if (local_decl) {
|
||||||
|
local_decl = SwigType_typedef_resolve_all(local_decl);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Width first search */
|
/* Width first search */
|
||||||
for (int i = 0; i < Len(bases); i++) {
|
for (int i = 0; i < Len(bases); i++) {
|
||||||
b = Getitem(bases,i);
|
b = Getitem(bases,i);
|
||||||
temp = firstChild (b);
|
temp = firstChild (b);
|
||||||
while (temp) {
|
while (temp) {
|
||||||
if ( (checkAttribute(temp, "storage", "virtual")) &&
|
base_decl = Getattr(temp, "decl");
|
||||||
(checkAttribute(temp, "name", name)) &&
|
if (base_decl) {
|
||||||
(checkAttribute(temp, "type", type)) &&
|
base_decl = SwigType_typedef_resolve_all(base_decl);
|
||||||
(checkAttribute(temp, "decl", decl)) ) {
|
|
||||||
Setattr(c, "Tiger: defined_in_base", "1");
|
if ( (checkAttribute(temp, "storage", "virtual")) &&
|
||||||
Setattr(c, "feature:ignore", "1");
|
(checkAttribute(temp, "name", name)) &&
|
||||||
return 1;
|
(checkAttribute(temp, "type", type)) &&
|
||||||
|
(!Strcmp(local_decl, base_decl)) ) {
|
||||||
|
Setattr(c, "Tiger: defined_in_base", "1");
|
||||||
|
Setattr(c, "feature:ignore", "1");
|
||||||
|
Delete(base_decl);
|
||||||
|
Delete(local_decl);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
Delete(base_decl);
|
||||||
}
|
}
|
||||||
temp = nextSibling(temp);
|
temp = nextSibling(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Delete(local_decl);
|
||||||
for (int i = 0; i < Len(bases); i++) {
|
for (int i = 0; i < Len(bases); i++) {
|
||||||
b = Getitem(bases,i);
|
b = Getitem(bases,i);
|
||||||
if (function_is_defined_in_bases(c, Getattr(b, "bases")))
|
if (function_is_defined_in_bases(c, Getattr(b, "bases")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue