global unnamed structures ignored

This commit is contained in:
Vladimir Kalinin 2014-05-15 03:13:25 +04:00
commit 3692e175bc
3 changed files with 13 additions and 1 deletions

View file

@ -87,5 +87,9 @@ typedef struct {
int d;
} bar;
} FOO;
struct {
int i;
} THING;
%}

View file

@ -396,7 +396,12 @@ void Swig_nested_name_unnamed_c_structs(Node *n) {
Delete(ins);
Delattr(c, "nested:outer");
} else {
// global unnamed struct - ignore it
// global unnamed struct - ignore it and it's instances
SetFlag(c, "feature:ignore");
while (next && Getattr(next, "nested:unnamedtype") == c) {
SetFlag(next, "feature:ignore");
next = nextSibling(next);
}
c = next;
continue;
}

View file

@ -661,6 +661,9 @@ class TypePass:private Dispatcher {
* ------------------------------------------------------------ */
virtual int cDeclaration(Node *n) {
if (GetFlag(n, "feature:ignore")) {
return SWIG_OK;
}
if (NoExcept) {
Delattr(n, "throws");
}