fix for unnamed types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8113 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d0fbab350b
commit
801a09f146
2 changed files with 9 additions and 2 deletions
|
|
@ -1014,6 +1014,7 @@ typedef struct Nested {
|
||||||
int line; /* line number where it starts */
|
int line; /* line number where it starts */
|
||||||
char *name; /* Name associated with this nested class */
|
char *name; /* Name associated with this nested class */
|
||||||
char *kind; /* Kind of class */
|
char *kind; /* Kind of class */
|
||||||
|
int unnamed; /* unnamed class */
|
||||||
SwigType *type; /* Datatype associated with the name */
|
SwigType *type; /* Datatype associated with the name */
|
||||||
struct Nested *next; /* Next code fragment in list */
|
struct Nested *next; /* Next code fragment in list */
|
||||||
} Nested;
|
} Nested;
|
||||||
|
|
@ -1066,6 +1067,10 @@ static Node *dump_nested(const char *parent) {
|
||||||
Setattr(retx,"type",nt);
|
Setattr(retx,"type",nt);
|
||||||
Delete(nt);
|
Delete(nt);
|
||||||
Setattr(retx,"nested",parent);
|
Setattr(retx,"nested",parent);
|
||||||
|
if (n->unnamed) {
|
||||||
|
Setattr(retx,"unnamed","1");
|
||||||
|
}
|
||||||
|
|
||||||
add_symbols(retx);
|
add_symbols(retx);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
set_nextSibling(retx,ret);
|
set_nextSibling(retx,ret);
|
||||||
|
|
@ -4152,6 +4157,7 @@ cpp_nested : storage_class cpptype ID LBRACE { cparse_start_line = cparse_line
|
||||||
n->line = cparse_start_line;
|
n->line = cparse_start_line;
|
||||||
n->type = NewStringEmpty();
|
n->type = NewStringEmpty();
|
||||||
n->kind = $2;
|
n->kind = $2;
|
||||||
|
n->unnamed = 0;
|
||||||
SwigType_push(n->type, $6.type);
|
SwigType_push(n->type, $6.type);
|
||||||
n->next = 0;
|
n->next = 0;
|
||||||
add_nested(n);
|
add_nested(n);
|
||||||
|
|
@ -4179,6 +4185,7 @@ cpp_nested : storage_class cpptype ID LBRACE { cparse_start_line = cparse_line
|
||||||
n->line = cparse_start_line;
|
n->line = cparse_start_line;
|
||||||
n->type = NewStringEmpty();
|
n->type = NewStringEmpty();
|
||||||
n->kind = $2;
|
n->kind = $2;
|
||||||
|
n->unnamed = 1;
|
||||||
SwigType_push(n->type,$5.type);
|
SwigType_push(n->type,$5.type);
|
||||||
n->next = 0;
|
n->next = 0;
|
||||||
add_nested(n);
|
add_nested(n);
|
||||||
|
|
|
||||||
|
|
@ -1269,7 +1269,7 @@ Language::membervariableHandler(Node *n) {
|
||||||
}
|
}
|
||||||
int flags = Extend | SmartPointer;
|
int flags = Extend | SmartPointer;
|
||||||
|
|
||||||
if (naturalvar_mode || GetFlag(n,"feature:naturalvar")) {
|
if ((naturalvar_mode || GetFlag(n,"feature:naturalvar")) && !Getattr(n,"unnamed")) {
|
||||||
flags |= CWRAP_NATURAL_VAR;
|
flags |= CWRAP_NATURAL_VAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1318,7 +1318,7 @@ Language::membervariableHandler(Node *n) {
|
||||||
/* Emit get function */
|
/* Emit get function */
|
||||||
{
|
{
|
||||||
int flags = Extend | SmartPointer;
|
int flags = Extend | SmartPointer;
|
||||||
if (naturalvar_mode || GetFlag(n,"feature:naturalvar")) {
|
if ((naturalvar_mode || GetFlag(n,"feature:naturalvar")) && !Getattr(n,"unnamed")) {
|
||||||
flags |= CWRAP_NATURAL_VAR;
|
flags |= CWRAP_NATURAL_VAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue