Commit b13b05f6 by Per Bothner

cpplib.c: Rename make_definition to cpp_define.

* cpplib.c:  Rename  make_definition to cpp_define.
* cpplib.c (special_symbol):  For T_SPECLINE, calculate __LINE__
in enclosing file buffer, not current buffer (if macro expanding).
(cpp_get_token):  Fix thinko (in code for chopping unneeded space).

From-SVN: r9403
parent 8229b922
...@@ -259,7 +259,6 @@ extern char *xmalloc (); ...@@ -259,7 +259,6 @@ extern char *xmalloc ();
static void add_import (); static void add_import ();
static void append_include_chain (); static void append_include_chain ();
static void make_undef (); static void make_undef ();
static void make_definition ();
static void make_assertion (); static void make_assertion ();
static void path_include (); static void path_include ();
static void initialize_builtins (); static void initialize_builtins ();
...@@ -614,8 +613,8 @@ cpp_grow_buffer (pfile, n) ...@@ -614,8 +613,8 @@ cpp_grow_buffer (pfile, n)
* be identifier=definition. * be identifier=definition.
*/ */
static void void
make_definition (pfile, str) cpp_define (pfile, str)
cpp_reader *pfile; cpp_reader *pfile;
U_CHAR *str; U_CHAR *str;
{ {
...@@ -2479,9 +2478,8 @@ special_symbol (hp, pfile) ...@@ -2479,9 +2478,8 @@ special_symbol (hp, pfile)
case T_SPECLINE: case T_SPECLINE:
{ {
long line = CPP_BUFFER (pfile)->lineno; long line = ip->lineno;
long col = CPP_BUFFER (pfile)->colno; long col = ip->colno;
cpp_buffer *ip = CPP_BUFFER (pfile);
adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col); adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col);
buf = (char *) alloca (10); buf = (char *) alloca (10);
...@@ -5223,7 +5221,7 @@ cpp_get_token (pfile) ...@@ -5223,7 +5221,7 @@ cpp_get_token (pfile)
unneeded extra spaces (for the sake of cpp-using tools like unneeded extra spaces (for the sake of cpp-using tools like
imake). Here we remove the space if it is safe to do so. */ imake). Here we remove the space if it is safe to do so. */
if (pfile->buffer->rlimit - pfile->buffer->cur >= 2 if (pfile->buffer->rlimit - pfile->buffer->cur >= 2
&& pfile->buffer->cur[-1] == ' ') && pfile->buffer->rlimit[-1] == ' ')
{ {
int c1 = pfile->buffer->rlimit[-2]; int c1 = pfile->buffer->rlimit[-2];
int c2 = CPP_BUF_PEEK (CPP_PREV_BUFFER (CPP_BUFFER (pfile))); int c2 = CPP_BUF_PEEK (CPP_PREV_BUFFER (CPP_BUFFER (pfile)));
...@@ -5807,7 +5805,7 @@ push_parse_file (pfile, fname) ...@@ -5807,7 +5805,7 @@ push_parse_file (pfile, fname)
*p++= 0; *p++= 0;
if (opts->debug_output) if (opts->debug_output)
output_line_command (pfile, 0, same_file); output_line_command (pfile, 0, same_file);
make_definition (pfile, q); cpp_define (pfile, q);
while (*p == ' ' || *p == '\t') while (*p == ' ' || *p == '\t')
p++; p++;
} else if (p[0] == '-' && p[1] == 'A') { } else if (p[0] == '-' && p[1] == 'A') {
...@@ -5880,7 +5878,7 @@ push_parse_file (pfile, fname) ...@@ -5880,7 +5878,7 @@ push_parse_file (pfile, fname)
case 'D': case 'D':
if (opts->debug_output) if (opts->debug_output)
output_line_command (pfile, 0, same_file); output_line_command (pfile, 0, same_file);
make_definition (pfile, pend->arg); cpp_define (pfile, pend->arg);
break; break;
case 'A': case 'A':
make_assertion (pfile, "-A", pend->arg); make_assertion (pfile, "-A", pend->arg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment