Fixed [ 642112 ] Constants char bug
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4402 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e53b7ddc08
commit
8ab03e95ec
2 changed files with 8 additions and 2 deletions
|
|
@ -4120,9 +4120,11 @@ definetype : { /* scanner_check_typedef(); */ } expr {
|
|||
| CHARCONST {
|
||||
$$.val = NewString($1);
|
||||
if (Len($$.val)) {
|
||||
$$.rawval = NewStringf("\'%(escape)s\'",$$.val);
|
||||
/* $$.rawval = NewStringf("\'%(escape)s\'",$$.val); */
|
||||
$$.rawval = NewStringf("\'%s\'", $$.val);
|
||||
} else {
|
||||
$$.rawval = NewString("\'\\0'");
|
||||
$$.val = NewString("\\0");
|
||||
}
|
||||
$$.type = T_CHAR;
|
||||
$$.bitfield = 0;
|
||||
|
|
|
|||
|
|
@ -402,7 +402,11 @@ int Language::constantDirective(Node *n) {
|
|||
if (!value) {
|
||||
value = Copy(name);
|
||||
} else {
|
||||
value = NewStringf("%(escape)s", value);
|
||||
if (checkAttribute(n,"type","char")) {
|
||||
value = NewString(value);
|
||||
} else {
|
||||
value = NewStringf("%(escape)s", value);
|
||||
}
|
||||
}
|
||||
Setattr(n,"value", value);
|
||||
this->constantWrapper(n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue