* cpplib.h (enum cpp_token): Added CPP_WCHAR and CPP_WSTRING.
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2000 19:21:07 +0000 (19:21 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2000 19:21:07 +0000 (19:21 +0000)
* cpplib.c (cpp_get_token): Produce them.
* cppexp.c (cpp_lex): Handle them.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32121 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cppexp.c
gcc/cpplib.c
gcc/cpplib.h

index 24ddde4..2aaccfb 100644 (file)
@@ -1,3 +1,9 @@
+2000-02-23  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * cpplib.h (enum cpp_token): Added CPP_WCHAR and CPP_WSTRING.
+       * cpplib.c (cpp_get_token): Produce them.
+       * cppexp.c (cpp_lex): Handle them.
+
 2000-02-23  Nick Clifton  <nickc@cygnus.com>
 
        * config/arm/arm.c (arm_comp_type_attributes): Simply and
index a7db2ce..f659559 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse C expressions for CCCP.
-   Copyright (C) 1987, 92, 94, 95, 97, 98, 1999 Free Software Foundation.
+   Copyright (C) 1987, 92, 94, 95, 97, 98, 1999, 2000 Free Software Foundation.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -397,10 +397,13 @@ cpp_lex (pfile, skip_evaluation)
     case CPP_NUMBER:
       return parse_number (pfile, tok_start, tok_end);
     case CPP_STRING:
+    case CPP_WSTRING:
       cpp_error (pfile, "string constants are not allowed in #if expressions");
       op.op = ERROR;
       return op;
+
     case CPP_CHAR:
+    case CPP_WCHAR:
       return parse_charconst (pfile, tok_start, tok_end);
 
     case CPP_NAME:
index 9ffa4a1..43a3bfa 100644 (file)
@@ -2447,7 +2447,6 @@ cpp_get_token (pfile)
 
        case '\"':
        case '\'':
-       string:
          parse_string (pfile, c);
          pfile->only_seen_white = 0;
          return c == '\'' ? CPP_CHAR : CPP_STRING;
@@ -2600,7 +2599,9 @@ cpp_get_token (pfile)
            {
              CPP_PUTC (pfile, c);
              c = GETC ();
-             goto string;
+             parse_string (pfile, c);
+             pfile->only_seen_white = 0;
+             return c == '\'' ? CPP_WCHAR : CPP_WSTRING;
            }
          goto letter;
 
index 82eb55c..592093c 100644 (file)
@@ -43,7 +43,9 @@ enum cpp_token {
   CPP_NAME,
   CPP_NUMBER,
   CPP_CHAR,
+  CPP_WCHAR,
   CPP_STRING,
+  CPP_WSTRING,
   CPP_DIRECTIVE,
   CPP_LPAREN,   /* "(" */
   CPP_RPAREN,   /* ")" */