Commit 645ebf37 by Doug Evans Committed by Doug Evans

c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling.

	* c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
	(yylex): Record wide strings using target endianness, not host.

From-SVN: r16315
parent f7620587
Tue Nov 4 13:40:35 1997 Doug Evans <devans@canuck.cygnus.com>
* c-lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
(yylex): Record wide strings using target endianness, not host.
Tue Nov 4 13:13:12 1997 Jeffrey A Law (law@cygnus.com) Tue Nov 4 13:13:12 1997 Jeffrey A Law (law@cygnus.com)
* mn10200.h (ASM_OUTPUT_BSS): Delete. * mn10200.h (ASM_OUTPUT_BSS): Delete.
......
...@@ -35,6 +35,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,6 +35,13 @@ Boston, MA 02111-1307, USA. */
#include <ctype.h> #include <ctype.h>
/* MULTIBYTE_CHARS support only works for native compilers.
??? Ideally what we want is to model widechar support after
the current floating point support. */
#ifdef CROSS_COMPILE
#undef MULTIBYTE_CHARS
#endif
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <stdlib.h> #include <stdlib.h>
#include <locale.h> #include <locale.h>
...@@ -1999,15 +2006,9 @@ yylex () ...@@ -1999,15 +2006,9 @@ yylex ()
bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES); bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES);
#else #else
{ {
union { long l; char c[sizeof (long)]; } u;
int big_endian;
char *wp, *cp; char *wp, *cp;
/* Determine whether host is little or big endian. */ wp = widep + (BYTES_BIG_ENDIAN ? WCHAR_BYTES - 1 : 0);
u.l = 1;
big_endian = u.c[sizeof (long) - 1];
wp = widep + (big_endian ? WCHAR_BYTES - 1 : 0);
bzero (widep, (p - token_buffer) * WCHAR_BYTES); bzero (widep, (p - token_buffer) * WCHAR_BYTES);
for (cp = token_buffer + 1; cp < p; cp++) for (cp = token_buffer + 1; cp < p; cp++)
*wp = *cp, wp += WCHAR_BYTES; *wp = *cp, wp += WCHAR_BYTES;
......
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