From 64cdc38350d29ed0e2d5fa0b4bdd074ec69135dd Mon Sep 17 00:00:00 2001 From: Matthew Hiller Date: Wed, 24 Apr 2002 22:18:25 +0000 Subject: cpplex.c: Remove conditional #undef of MULTIBYTE_CHARS. 2002-04-24 Matt Hiller * cpplex.c: Remove conditional #undef of MULTIBYTE_CHARS. * c-lex.c: Ditto. * cpplex.c (skip_line_comment): Process comment one multibyte character at a time rather than one char at a time, if appropriate. (parse_string): Process string one multibyte character at a time rather than one char at a time, if appropriate. * c-lex.c (lex_string): Lex and copy multibyte strings appropriately. * cpplib.h (cppchar_t): Change to unsigned. From-SVN: r52737 --- gcc/c-lex.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'gcc/c-lex.c') diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 8a76dd3..f2f8c8c 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -40,13 +40,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "splay-tree.h" #include "debug.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 "mbchar.h" #include @@ -1282,8 +1275,8 @@ lex_string (str, len, wide) c = cpp_parse_escape (parse_in, &p, limit, mask); } - /* Add this single character into the buffer either as a wchar_t - or as a single byte. */ + /* Add this single character into the buffer either as a wchar_t, + a multibyte sequence, or as a single byte. */ if (wide) { unsigned charwidth = TYPE_PRECISION (char_type_node); @@ -1304,6 +1297,16 @@ lex_string (str, len, wide) } q += WCHAR_BYTES; } +#ifdef MULTIBYTE_CHARS + else if (char_len > 1) + { + /* We're dealing with a multibyte character. */ + for ( ; char_len >0; --char_len) + { + *q++ = *(p - char_len); + } + } +#endif else { *q++ = c; -- cgit v1.1