Commit b0089a92 by DJ Delorie Committed by DJ Delorie

c-common.c (combine_strings): Widen strings in a host-endian-independent way.

* c-common.c (combine_strings): Widen strings in a
host-endian-independent way.

From-SVN: r41941
parent 25d78ace
2001-05-10 DJ Delorie <dj@redhat.com>
* c-common.c (combine_strings): Widen strings in a
host-endian-independent way.
2001-05-10 Joseph S. Myers <jsm28@cam.ac.uk> 2001-05-10 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in: Remove many shift/reduce conflicts. Update * c-parse.in: Remove many shift/reduce conflicts. Update
......
...@@ -583,15 +583,22 @@ combine_strings (strings) ...@@ -583,15 +583,22 @@ combine_strings (strings)
} }
else else
{ {
int i; int i, j;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
if (WCHAR_TYPE_SIZE == HOST_BITS_PER_SHORT) if (BYTES_BIG_ENDIAN)
((short *) q)[i] = TREE_STRING_POINTER (t)[i]; {
for (j=0; j<(WCHAR_TYPE_SIZE / BITS_PER_UNIT)-1; j++)
*q++ = 0;
*q++ = TREE_STRING_POINTER (t)[i];
}
else else
((int *) q)[i] = TREE_STRING_POINTER (t)[i]; {
*q++ = TREE_STRING_POINTER (t)[i];
for (j=0; j<(WCHAR_TYPE_SIZE / BITS_PER_UNIT)-1; j++)
*q++ = 0;
}
} }
q += len * wchar_bytes;
} }
} }
if (wide_flag) if (wide_flag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment