Fix %javaconst(1)/%csconst(1) for static const member variables to use the actual constant value if available

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11758 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-11-26 19:20:31 +00:00
commit 1dd50f5ea8
4 changed files with 19 additions and 2 deletions

View file

@ -1394,7 +1394,7 @@ public:
enum_constant_flag = false;
} else {
// Alternative constant handling will use the C syntax to make a true C# constant and hope that it compiles as C# code
Printf(constants_code, "%s;\n", Getattr(n, "value"));
Printf(constants_code, "%s;\n", Getattr(n, "wrappedasconstant") ? Getattr(n, "staticmembervariableHandler:value") : Getattr(n, "value"));
}
// Emit the generated code to appropriate place

View file

@ -1426,7 +1426,7 @@ public:
enum_constant_flag = false;
} else {
// Alternative constant handling will use the C syntax to make a true Java constant and hope that it compiles as Java code
Printf(constants_code, "%s;\n", Getattr(n, "value"));
Printf(constants_code, "%s;\n", Getattr(n, "wrappedasconstant") ? Getattr(n, "staticmembervariableHandler:value") : Getattr(n, "value"));
}
// Emit the generated code to appropriate place