diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-10 17:39:19 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-10 17:39:19 +0000 |
commit | 8195e9cad8cebaaf1edaef7a2ab381111b872c8c (patch) | |
tree | 8c669d7a707810b2bc18d7b1031872859e3a5a89 /gcc/c-common.c | |
parent | 84af172482decabb416560b20ac1ec12e9ab3a7d (diff) | |
download | gcc-8195e9cad8cebaaf1edaef7a2ab381111b872c8c.tar.gz |
* c-common.c (combine_strings): Widen strings in a
host-endian-independent way.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 751d67d2e0d..a1dc31c3160 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -583,15 +583,22 @@ combine_strings (strings) } else { - int i; + int i, j; for (i = 0; i < len; i++) { - if (WCHAR_TYPE_SIZE == HOST_BITS_PER_SHORT) - ((short *) q)[i] = TREE_STRING_POINTER (t)[i]; + if (BYTES_BIG_ENDIAN) + { + for (j=0; j<(WCHAR_TYPE_SIZE / BITS_PER_UNIT)-1; j++) + *q++ = 0; + *q++ = TREE_STRING_POINTER (t)[i]; + } 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) |