Fix constants involved parenthesised char literals
Fixes https://sourceforge.net/p/swig/bugs/1168/
This commit is contained in:
parent
5adc133369
commit
0863eca5e7
2 changed files with 10 additions and 2 deletions
|
|
@ -95,6 +95,11 @@
|
|||
#define EXPR_CHAR_COMPOUND_LSHIFT 'B' << 6
|
||||
#define H_SUPPRESS_SCALING_MAGIC (('s'<<24) | ('u'<<16) | ('p'<<8) | 'p')
|
||||
|
||||
// https://sourceforge.net/p/swig/bugs/1168/
|
||||
#define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
|
||||
#define DEFAULT_LANG CHR('d','f','l','t')
|
||||
%constant DEFAULT_LANG_SIMPLIFIED = ('d')<<24;
|
||||
|
||||
/// constant assignment in enum
|
||||
#if defined(SWIGCSHARP)
|
||||
%csconstvalue("1<<2") kValue;
|
||||
|
|
|
|||
|
|
@ -6316,9 +6316,12 @@ valexpr : exprnum { $$ = $1; }
|
|||
|
||||
/* grouping */
|
||||
| LPAREN expr RPAREN %prec CAST {
|
||||
$$.val = NewStringf("(%s)",$2.val);
|
||||
$$.val = NewStringf("(%s)",$2.val);
|
||||
if ($2.rawval) {
|
||||
$$.rawval = NewStringf("(%s)",$2.rawval);
|
||||
}
|
||||
$$.type = $2.type;
|
||||
}
|
||||
}
|
||||
|
||||
/* A few common casting operations */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue