Java enum and static member variable escaping fix for chars
For example:
enum X { x = '\1' };
struct A {
static const char a = '\n';
};
This commit is contained in:
parent
62c34fc9d9
commit
83584e504a
1 changed files with 2 additions and 2 deletions
|
|
@ -1375,7 +1375,7 @@ public:
|
|||
const char *val = Equal(Getattr(n, "enumvalue"), "true") ? "1" : "0";
|
||||
Setattr(n, "enumvalue", val);
|
||||
} else if (swigtype == T_CHAR) {
|
||||
String *val = NewStringf("'%s'", Getattr(n, "enumvalue"));
|
||||
String *val = NewStringf("'%(escape)s'", Getattr(n, "enumvalue"));
|
||||
Setattr(n, "enumvalue", val);
|
||||
Delete(val);
|
||||
}
|
||||
|
|
@ -1573,7 +1573,7 @@ public:
|
|||
// Alternative constant handling will use the C syntax to make a true Java constant and hope that it compiles as Java code
|
||||
if (Getattr(n, "wrappedasconstant")) {
|
||||
if (SwigType_type(t) == T_CHAR)
|
||||
Printf(constants_code, "\'%s\';\n", Getattr(n, "staticmembervariableHandler:value"));
|
||||
Printf(constants_code, "\'%(escape)s\';\n", Getattr(n, "staticmembervariableHandler:value"));
|
||||
else
|
||||
Printf(constants_code, "%s;\n", Getattr(n, "staticmembervariableHandler:value"));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue