aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDoug Evans <devans@canuck.cygnus.com>1997-11-04 21:57:40 +0000
committerDoug Evans <devans@gcc.gnu.org>1997-11-04 21:57:40 +0000
commit30c317f5da1ff0144dd6dd8143d830a2223f17b8 (patch)
tree6e5824cdf2a2aee795d3481abd464a929eccdf16 /gcc
parent645ebf3767cd0300bd13971385806f6cec547f05 (diff)
downloadgcc-30c317f5da1ff0144dd6dd8143d830a2223f17b8.zip
gcc-30c317f5da1ff0144dd6dd8143d830a2223f17b8.tar.gz
gcc-30c317f5da1ff0144dd6dd8143d830a2223f17b8.tar.bz2
lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
* lex.c (MULTIBYTE_CHARS): #undef if cross compiling. (real_yylex): Record wide strings using target endianness, not host. From-SVN: r16316
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/lex.c15
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 06808f5..ddedf65 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
+ (real_yylex): Record wide strings using target endianness, not host.
+
1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
* repo.c (rindex): Add decl unconditionally.
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 1f0e5e9..d45fe67 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -39,6 +39,13 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "c-pragma.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
#include <stdlib.h>
#include <locale.h>
@@ -4064,15 +4071,9 @@ real_yylex ()
bzero (widep + (len * WCHAR_BYTES), WCHAR_BYTES);
#else
{
- union { long l; char c[sizeof (long)]; } u;
- int big_endian;
char *wp, *cp;
- /* Determine whether host is little or big endian. */
- u.l = 1;
- big_endian = u.c[sizeof (long) - 1];
- wp = widep + (big_endian ? WCHAR_BYTES - 1 : 0);
-
+ wp = widep + (BYTES_BIG_ENDIAN ? WCHAR_BYTES - 1 : 0);
bzero (widep, (p - token_buffer) * WCHAR_BYTES);
for (cp = token_buffer + 1; cp < p; cp++)
*wp = *cp, wp += WCHAR_BYTES;