Fix for unnamed enum member variables
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5882 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
56211014e6
commit
d80d8dba3b
1 changed files with 6 additions and 2 deletions
|
|
@ -52,7 +52,6 @@ static int inherit_list = 0;
|
||||||
static Parm *template_parameters = 0;
|
static Parm *template_parameters = 0;
|
||||||
static int extendmode = 0;
|
static int extendmode = 0;
|
||||||
static int dirprot_mode = 0;
|
static int dirprot_mode = 0;
|
||||||
static int tempext_mode = 0;
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Assist Functions
|
* Assist Functions
|
||||||
|
|
@ -2331,7 +2330,12 @@ c_enum_decl : storage_class ENUM ename LBRACE enumlist RBRACE SEMI {
|
||||||
unnamed = make_unnamed();
|
unnamed = make_unnamed();
|
||||||
ty = NewStringf("enum %s", unnamed);
|
ty = NewStringf("enum %s", unnamed);
|
||||||
Setattr($$,"unnamed",unnamed);
|
Setattr($$,"unnamed",unnamed);
|
||||||
Setattr($$,"name",$7.id);
|
/* name is not set for unnamed enum instances, e.g. enum { foo } Instance; */
|
||||||
|
if ($1 && Cmp($1,"typedef") == 0) {
|
||||||
|
Setattr($$,"name",$7.id);
|
||||||
|
} else {
|
||||||
|
Setattr($$,"unnamedinstance","1");
|
||||||
|
}
|
||||||
Setattr($$,"storage",$1);
|
Setattr($$,"storage",$1);
|
||||||
}
|
}
|
||||||
if ($7.id && Cmp($1,"typedef") == 0) {
|
if ($7.id && Cmp($1,"typedef") == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue