+2004-09-17 Zack Weinberg <zack@codesourcery.com>
+
+ * directives.c (do_pragma): Save current buffer position
+ before lexing the pragma keywords; don't call
+ _cpp_backup_tokens in the defer_pragmas case.
+
2004-09-15 Per Bothner <per@bothner.com>
* include/line-map.h (line_map_start): Add parameter names so
const cpp_token *token, *pragma_token = pfile->cur_token;
unsigned int count = 1;
+ /* Save the current position so that defer_pragmas mode can
+ copy the entire current line to a string. It will not work
+ to use _cpp_backup_tokens as that does not reverse buffer->cur. */
+ const uchar *line_start = CPP_BUFFER (pfile)->cur;
+
pfile->state.prevent_expansion++;
token = cpp_get_token (pfile);
else if (CPP_OPTION (pfile, defer_pragmas))
{
/* Squirrel away the pragma text. Pragmas are newline-terminated. */
- const uchar *line_start, *line_end;
+ const uchar *line_end;
uchar *s;
cpp_string body;
cpp_token *ptok;
- _cpp_backup_tokens (pfile, count);
- line_start = CPP_BUFFER (pfile)->cur;
line_end = ustrchr (line_start, '\n');
body.len = (line_end - line_start) + 1;