aboutsummaryrefslogtreecommitdiff
path: root/gcc/ch
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>1998-10-01 10:53:39 +0000
committerNick Clifton <nickc@gcc.gnu.org>1998-10-01 10:53:39 +0000
commit43cab252f98671186dc5aae755081c183a8f4595 (patch)
treefc626d778b9504a825599cf41a22ed452f2d8a8f /gcc/ch
parenta09a009c459a7314cef619c329c9291a59fdb077 (diff)
downloadgcc-43cab252f98671186dc5aae755081c183a8f4595.zip
gcc-43cab252f98671186dc5aae755081c183a8f4595.tar.gz
gcc-43cab252f98671186dc5aae755081c183a8f4595.tar.bz2
Replace occurances of HANDLE_SYSV_PRAGMA with HANDLE_GENERIC_PRAGMAS.
handle_generic_pragma() New function: Parse generic pragmas. From-SVN: r22712
Diffstat (limited to 'gcc/ch')
-rw-r--r--gcc/ch/ChangeLog6
-rw-r--r--gcc/ch/lex.c52
2 files changed, 57 insertions, 1 deletions
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
index 316a87d..34f8044 100644
--- a/gcc/ch/ChangeLog
+++ b/gcc/ch/ChangeLog
@@ -1,3 +1,9 @@
+Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
+
+ * lex.c: Replace occurances of HANDLE_SYSV_PRAGMA with
+ HANDLE_GENERIC_PRAGMAS.
+ (handle_generic_pragma): New function: Parse generic pragmas.
+
Wed Sep 30 20:22:34 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* parse.c (emit_label): Fix return-type of prototype.
diff --git a/gcc/ch/lex.c b/gcc/ch/lex.c
index bc50f64..38c8fa4 100644
--- a/gcc/ch/lex.c
+++ b/gcc/ch/lex.c
@@ -1480,6 +1480,49 @@ pragma_ungetc (arg)
}
#endif /* HANDLE_PRAGMA */
+#ifdef HANDLE_GENERIC_PRAGMAS
+/* Handle a generic #pragma directive.
+ BUFFER contains the text we read after `#pragma'. Processes the entire input
+ line and return non-zero iff the pragma was successfully processed. */
+
+static int
+handle_generic_pragma (buffer)
+ char * buffer;
+{
+ register int c;
+
+ for (;;)
+ {
+ char * buff;
+
+ handle_pragma_token (buffer, NULL);
+
+ c = getc (finput);
+
+ while (c == ' ' || c == '\t')
+ c = getc (finput);
+ ungetc (c, finput);
+
+ if (c == '\n' || c == EOF)
+ return handle_pragma_token (NULL, NULL);
+
+ /* Read the next word of the pragma into the buffer. */
+ buff = buffer;
+ do
+ {
+ * buff ++ = c;
+ c = getc (finput);
+ }
+ while (c != EOF && isascii (c) && ! isspace (c) && c != '\n'
+ && buff < buffer + 128); /* XXX shared knowledge about size of buffer. */
+
+ ungetc (c, finput);
+
+ * -- buff = 0;
+ }
+}
+#endif /* HANDLE_GENERIC_PRAGMAS */
+
/* At the beginning of a line, increment the line number and process
any #-directive on this line. If the line is a #-directive, read
the entire line and return a newline. Otherwise, return the line's
@@ -1557,8 +1600,15 @@ check_newline ()
* -- buff = 0;
- (void) HANDLE_PRAGMA (pragma_getc, pragma_ungetc, buffer);
+ if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc, buffer))
+ goto skipline;
#endif /* HANDLE_PRAGMA */
+
+#ifdef HANDLE_GENERIC_PRAGMAS
+ if (handle_generic_pragma (buffer))
+ goto skipline;
+#endif /* HANDLE_GENERIC_PRAGMAS */
+
goto skipline;
}
}