diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2010-05-14 19:03:01 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2010-05-14 19:03:01 +0000 |
commit | 76bbd7373d469149b8cfa091c32cf35d34861da3 (patch) | |
tree | 222176e3eb067230f0bd3f4ab14d742bbfa86410 /Source | |
parent | 8a169eb0cb80b85d656f728b6659c6937dca9148 (diff) | |
download | swig-76bbd7373d469149b8cfa091c32cf35d34861da3.tar.gz |
Fix wrapping of C++ enum boolean values when using %javaconst(1)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12029 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules/java.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 5fecf8208..234af4c8e 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -1352,6 +1352,13 @@ public: // Note that this is used in enumValue() amongst other places Setattr(n, "value", tmpValue); + // Deal with enum values that are bools + if (SwigType_type(Getattr(n, "type")) == T_BOOL) { + String *boolValue = NewStringf("%s ? 1 : 0", Getattr(n, "enumvalue")); + Setattr(n, "enumvalue", boolValue); + Delete(boolValue); + } + { EnumFeature enum_feature = decodeEnumFeature(parent); |