aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-11-11 05:41:43 +0000
committerRichard Stallman <rms@gnu.org>1992-11-11 05:41:43 +0000
commit461819928caad65a96d7c1886a0051a48e7bcbf6 (patch)
treeacd3159f30e2ae3d5048b3b7c0816acc3fffaf93 /gcc
parentde5849f37316298334503c43b6b63a418c7d0cbe (diff)
downloadgcc-461819928caad65a96d7c1886a0051a48e7bcbf6.zip
gcc-461819928caad65a96d7c1886a0051a48e7bcbf6.tar.gz
gcc-461819928caad65a96d7c1886a0051a48e7bcbf6.tar.bz2
(rescan): Accept # as command inside macro args, etc.
if an actual newline at the same level precedes. From-SVN: r2741
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index c3487fd..3c88820 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -2260,9 +2260,14 @@ do { ip = &instack[indepth]; \
}
}
- /* Recognize preprocessor directives only when reading
- directly from a file. */
- if (ip->fname == 0)
+ /* If this is expanding a macro definition, don't recognize
+ preprocessor directives. */
+ if (ip->macro != 0)
+ goto randomchar;
+ /* If this is expand_into_temp_buffer, recognize them
+ only after an actual newline at this level,
+ not at the beginning of the input level. */
+ if (ip->fname == 0 && beg_of_line == ip->buf)
goto randomchar;
if (ident_length)
goto specialchar;