+2003-06-28 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpptrad.c (skip_macro_block_comment): New.
+ (copy_comment): Use it if appropriate.
+
2003-06-28 Kazu Hirata <kazu@cs.umass.edu>
* gcse.c (compute_ld_motion_mems): Use INSN_P instead of its
}
}
+/* Skip a C-style block comment in a macro as a result of -CC.
+ Buffer->cur points to the initial asterisk of the comment. */
+static void
+skip_macro_block_comment (cpp_reader *pfile)
+{
+ const uchar *cur = pfile->buffer->cur;
+
+ cur++;
+ if (*cur == '/')
+ cur++;
+
+ /* People like decorating comments with '*', so check for '/'
+ instead for efficiency. */
+ while(! (*cur++ == '/' && cur[-2] == '*') )
+ ;
+
+ pfile->buffer->cur = cur;
+}
+
/* CUR points to the asterisk introducing a comment in the current
context. IN_DEFINE is true if we are in the replacement text of a
macro.
cpp_buffer *buffer = pfile->buffer;
buffer->cur = cur;
- unterminated = _cpp_skip_block_comment (pfile);
+ if (pfile->context->prev)
+ unterminated = false, skip_macro_block_comment (pfile);
+ else
+ unterminated = _cpp_skip_block_comment (pfile);
+
if (unterminated)
cpp_error_with_line (pfile, DL_ERROR, from_line, 0,
"unterminated comment");