diff options
author | Doug Evans <dje@gnu.org> | 1995-03-21 01:27:13 +0000 |
---|---|---|
committer | Doug Evans <dje@gnu.org> | 1995-03-21 01:27:13 +0000 |
commit | 23f15b0c58c2efaad722345bbf3c5924a5b72b35 (patch) | |
tree | 32a9d8aec72500d80bd79521874a79bd0c2272d8 /gcc | |
parent | f0959e58ca77e179cb34859e32a1260b01b51cce (diff) | |
download | gcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.zip gcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.tar.gz gcc-23f15b0c58c2efaad722345bbf3c5924a5b72b35.tar.bz2 |
(do_xifdef): Handle c++ comments.
(do_endif): Likewise.
From-SVN: r9214
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cccp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -6953,7 +6953,11 @@ do_xifdef (buf, limit, op, keyword) U_CHAR c = *p++; if (is_space[c]) ; - else if (c == '/' && p != ip->bufp && *p == '*') { + /* ??? Why is the test with ip->bufp here? */ + /* ??? We don't handle \-n inside /-*. */ + /* ??? Comment handling in general could use a major cleanup. */ + else if (c == '/' && p != ip->bufp + && (*p == '*' || (cplusplus_comments && *p == '/'))) { /* Skip this comment. */ int junk = 0; U_CHAR *save_bufp = ip->bufp; @@ -7410,7 +7414,8 @@ do_endif (buf, limit, op, keyword) while (p != ep) { U_CHAR c = *p++; if (!is_space[c]) { - if (c == '/' && p != ep && *p == '*') { + if (c == '/' && p != ep + && (*p == '*' || (cplusplus_comments && *p == '/'))) { /* Skip this comment. */ int junk = 0; U_CHAR *save_bufp = ip->bufp; |