diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 10:53:39 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 10:53:39 +0000 |
commit | 817bf153b8631878bb4e8a47b17a574e0a5c03a2 (patch) | |
tree | fc626d778b9504a825599cf41a22ed452f2d8a8f /gcc/ch | |
parent | 0702857d73d4bf999d446fb21e2171a690e93653 (diff) | |
download | gcc-817bf153b8631878bb4e8a47b17a574e0a5c03a2.tar.gz |
Replace occurances of HANDLE_SYSV_PRAGMA with HANDLE_GENERIC_PRAGMAS.
handle_generic_pragma() New function: Parse generic pragmas.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ch')
-rw-r--r-- | gcc/ch/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ch/lex.c | 52 |
2 files changed, 57 insertions, 1 deletions
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog index 316a87ded21..34f804440aa 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 bc50f64a0af..38c8fa46276 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; } } |