Working around some of the SWIG internal issues with enums

This commit is contained in:
Artem Serebriyskiy 2014-03-12 18:00:15 +04:00
commit ddbf439db9
3 changed files with 19 additions and 2 deletions

View file

@ -70,6 +70,10 @@ assert(ns.Outer.Inner1.Color_colorStaticMethod == nil)
-- Enums and static methods of class marked as %nonspace should have backward compatible name
assert(ns.NoNSpacePlease_noNspaceStaticFunc() == 10)
-- assert(ns.NoNSpacePlease_NoNspace1 == 1)
-- assert(ns.NoNSpacePlease.NoNspace2 == 10)
assert(ns.Outer.Inner2.NoNSpacePlease_NoNspace == nil)
-- ReallyNoNSpaceEnum is wrapped into %nonspace and thus handled correctly.
-- NoNSpaceEnum is not (although both of them are in %nonspace-wrapped class) and thus
-- handled rather unexpectedly
assert(ns.NoNSpacePlease_ReallyNoNspace1 == 1)
assert(ns.NoNSpacePlease.ReallyNoNspace2 == 10)

View file

@ -10,6 +10,7 @@ SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
%nspace;
%nonspace Outer::Inner2::NoNSpacePlease;
%nonspace Outer::Inner2::NoNSpacePlease::ReallyNoNSpaceEnum;
%copyctor;
%ignore Outer::Inner2::Color::Color();
@ -70,6 +71,7 @@ namespace Outer {
class NoNSpacePlease {
public:
enum NoNSpaceEnum { NoNspace1 = 1, NoNspace2 = 10 };
enum ReallyNoNSpaceEnum { ReallyNoNspace1 = 1, ReallyNoNspace2 = 10 };
static int noNspaceStaticFunc() { return 10; }
};
} // Inner2