Add scoped enums into correct correct scope in type system. Note that cpp0x_strongly_typed_enumerations.i still shows further language symbol table problems which need fixing.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13841 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
38f6156a93
commit
6d655a7f41
2 changed files with 58 additions and 15 deletions
|
|
@ -834,16 +834,17 @@ class TypePass:private Dispatcher {
|
|||
virtual int enumvalueDeclaration(Node *n) {
|
||||
String *name = Getattr(n, "name");
|
||||
String *value = Getattr(n, "value");
|
||||
String *scopedenum = Getattr(parentNode(n), "scopedenum");
|
||||
if (!value)
|
||||
value = name;
|
||||
if (Strcmp(value, name) == 0) {
|
||||
String *new_value;
|
||||
if ((nsname || inclass) && cparse_cplusplus) {
|
||||
if ((nsname || inclass || scopedenum) && cparse_cplusplus) {
|
||||
new_value = NewStringf("%s::%s", SwigType_namestr(Swig_symbol_qualified(n)), value);
|
||||
} else {
|
||||
new_value = NewString(value);
|
||||
}
|
||||
if ((nsname || inclass) && !cparse_cplusplus) {
|
||||
if ((nsname || inclass || scopedenum) && !cparse_cplusplus) {
|
||||
String *cppvalue = NewStringf("%s::%s", SwigType_namestr(Swig_symbol_qualified(n)), value);
|
||||
Setattr(n, "cppvalue", cppvalue); /* for target languages that always generate C++ code even when wrapping C code */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue