@@ -84,7 +84,7 @@ void get_char_constant(struct token *token, unsigned long long *val)
end = p + type - TOKEN_WIDE_CHAR;
}
p = parse_escape(p, &v, end,
- type < TOKEN_WIDE_CHAR ? bits_in_char : 32, token->pos);
+ type < TOKEN_WIDE_CHAR ? bits_in_char : bits_in_wchar, token->pos);
if (p != end)
warning(token->pos,
"multi-character character constant");
@@ -113,7 +113,7 @@ struct token *get_string_constant(struct token *token, struct expression *expr)
done = next;
}
}
- bits = is_wide ? 32 : bits_in_char;
+ bits = is_wide ? bits_in_wchar : bits_in_char;
while (token != done) {
unsigned v;
const char *p = token->string->data;
@@ -22,6 +22,8 @@ int bits_in_long = 32;
int bits_in_longlong = 64;
int bits_in_longlonglong = 128;
+int bits_in_wchar = 32;
+
int max_int_alignment = 4;
/*
@@ -20,6 +20,8 @@ extern int bits_in_long;
extern int bits_in_longlong;
extern int bits_in_longlonglong;
+extern int bits_in_wchar;
+
extern int max_int_alignment;
/*
The size of wide chars was hardcoded to 32. Fix this by using a variable to hold this 'bits_in_wchar', like done for all others datatypes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- char.c | 4 ++-- target.c | 2 ++ target.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-)