Fix incorrect symbol clash error in C# and Java when using %rename for enums

When using using 'simple enum' wrappers
This commit is contained in:
William S Fulton 2014-11-21 19:50:23 +00:00
commit fcef37d682
4 changed files with 17 additions and 2 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.3 (in progress)
===========================
2014-11-21: wsfulton
[Java C#] Fix multiply defined error when using %rename of enum items when using the "simple enum" wrappers.
2014-10-28: vadz
[Python] Patch #201 The generated .py file no longer uses *args for all Python parameters.
Instead, the parameters are named using the C++ parameter names.

View file

@ -277,6 +277,18 @@ OldNameStruct::doublenametag renameTest6(OldNameStruct::doublenametag e)
OldNameStruct::singlename renameTest7(OldNameStruct::singlename e) { return e; }
%}
%rename(Clash1_di1) Clash1::di1;
%rename(Clash1_di2) Clash1::di2;
%rename(Clash1_di3) Clash1::di3;
%inline %{
namespace Clash1 {
enum DuplicateItems1 { di1, di2 = 10, di3 };
}
namespace Clash2 {
enum DuplicateItems2 { di1, di2 = 10, di3 };
}
%}
%inline %{
struct TreesClass {
enum trees {oak, fir, pine };

View file

@ -1308,7 +1308,7 @@ public:
else
Printf(scope, ".%s", Getattr(parent, "sym:name"));
}
if (!addSymbol(name, n, scope))
if (!addSymbol(symname, n, scope))
return SWIG_ERROR;
const String *csattributes = Getattr(n, "feature:cs:attributes");

View file

@ -1410,7 +1410,7 @@ public:
else
Printf(scope, ".%s", Getattr(parent, "sym:name"));
}
if (!addSymbol(name, n, scope))
if (!addSymbol(symname, n, scope))
return SWIG_ERROR;
if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) {