Merge branch 'wkalinin-csymbols-2' - %extend and nested structs

* wkalinin-csymbols-2:
  Add runtime test for %extend and nested union
  test fixed
  %extend symbols for nested structs get into a wrong C symbol table
This commit is contained in:
William S Fulton 2014-06-02 07:11:22 +01:00
commit 81d023ac05
3 changed files with 22 additions and 6 deletions

View file

@ -362,7 +362,15 @@ void Swig_nested_name_unnamed_c_structs(Node *n) {
Delete(bases);
}
Setattr(classhash, name, c);
// Merge the extension into the symbol table
if (Node *am = Getattr(Swig_extend_hash(), name)) {
Swig_extend_merge(c, am);
Swig_extend_append_previous(c, am);
Delattr(Swig_extend_hash(), name);
}
Swig_symbol_popscope();
// process declarations following this type (assign correct new type)
SwigType *ty = Copy(name);
Node *decl = nextSibling(c);
@ -376,12 +384,6 @@ void Swig_nested_name_unnamed_c_structs(Node *n) {
decl = nextSibling(decl);
}
Delete(ty);
if (Node *am = Getattr(Swig_extend_hash(), name)) {
// Merge the extension into the symbol table
Swig_extend_merge(c, am);
Swig_extend_append_previous(c, am);
Delattr(Swig_extend_hash(), name);
}
Swig_symbol_setscope(Swig_symbol_global_scope());
add_symbols_c(c);