Fix wrapping of C++ enum boolean values

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12028 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-05-14 18:46:20 +00:00
commit 8a169eb0cb
4 changed files with 26 additions and 4 deletions

View file

@ -1282,6 +1282,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);