diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-14 18:17:18 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-14 18:17:18 +0000 |
commit | 25266990096c508a66a45ded1711f9050155b875 (patch) | |
tree | 226bd8664bc5db227069d75069a5198366adb680 /gcc/cppmacro.c | |
parent | 0f43048ed4e4c00f3e1dbf644afc1a2de5c79854 (diff) | |
download | ppe42-gcc-25266990096c508a66a45ded1711f9050155b875.tar.gz ppe42-gcc-25266990096c508a66a45ded1711f9050155b875.zip |
* cpphash.h (struct lexer_state): Remove line_extension member.
* cpplib.c (dequote_string, do_linemarker): New functions.
(linemarker_dir): New data object.
(DIRECTIVE_TABLE): No longer need to interpret #line in
preprocessed source. Delete obsolete comment about return
values of handlers.
(end_directive, directive_diagnostics, _cpp_handle_directive):
Don't muck with line_extension.
(directive_diagnostics): No need to issue warnings for
linemarkers here.
(_cpp_handle_directive): Issue warnings for linemarkers here,
when appropriate. Dispatch linemarkers to do_linemarker, not
do_line.
(do_line): Code to handle linemarkers split out to do_linemarker.
Convert escape sequences in filename argument, both places.
* cppmacro.c (quote_string): Rename cpp_quote_string and
export. All callers changed.
* cpplib.h (cpp_quote_string): Prototype.
* cppmain.c (print_line): Call cpp_quote_string on to_file
before printing it.
* doc/cpp.texi: Document that escapes are now interpreted in
#line and in linemarkers, and that non-printing characters are
converted to octal escapes when linemarkers are generated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50779 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 302e0bd421b..c5bb71e7954 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -64,9 +64,6 @@ static cpp_context *next_context PARAMS ((cpp_reader *)); static const cpp_token *padding_token PARAMS ((cpp_reader *, const cpp_token *)); static void expand_arg PARAMS ((cpp_reader *, macro_arg *)); -static unsigned char *quote_string PARAMS ((unsigned char *, - const unsigned char *, - unsigned int)); static const cpp_token *new_string_token PARAMS ((cpp_reader *, U_CHAR *, unsigned int)); static const cpp_token *new_number_token PARAMS ((cpp_reader *, unsigned int)); @@ -164,7 +161,7 @@ builtin_macro (pfile, node) name = map->to_file; len = strlen (name); buf = _cpp_unaligned_alloc (pfile, len * 4 + 1); - len = quote_string (buf, (const unsigned char *) name, len) - buf; + len = cpp_quote_string (buf, (const unsigned char *) name, len) - buf; result = new_string_token (pfile, buf, len); } @@ -244,9 +241,10 @@ builtin_macro (pfile, node) /* Copies SRC, of length LEN, to DEST, adding backslashes before all backslashes and double quotes. Non-printable characters are - converted to octal. DEST must be of sufficient size. */ -static U_CHAR * -quote_string (dest, src, len) + converted to octal. DEST must be of sufficient size. Returns + a pointer to the end of the string. */ +U_CHAR * +cpp_quote_string (dest, src, len) U_CHAR *dest; const U_CHAR *src; unsigned int len; @@ -331,7 +329,7 @@ stringify_arg (pfile, arg) _cpp_buff *buff = _cpp_get_buff (pfile, len); unsigned char *buf = BUFF_FRONT (buff); len = cpp_spell_token (pfile, token, buf) - buf; - dest = quote_string (dest, buf, len); + dest = cpp_quote_string (dest, buf, len); _cpp_release_buff (pfile, buff); } else |