summaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-17 23:43:46 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-17 23:43:46 +0000
commit0b85f169a85c5b0b29a670ccde148d077e7b817e (patch)
treef592655b3b472ace8c42ba497babe946481f8b0b /gcc/cpplib.c
parent041eaf8c02a3dfba74ee6ec913f4e399db72e37b (diff)
downloadgcc-0b85f169a85c5b0b29a670ccde148d077e7b817e.tar.gz
* 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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 92df6be31be..a05a0c02ef9 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -259,7 +259,6 @@ extern char *xmalloc ();
static void add_import ();
static void append_include_chain ();
static void make_undef ();
-static void make_definition ();
static void make_assertion ();
static void path_include ();
static void initialize_builtins ();
@@ -614,8 +613,8 @@ cpp_grow_buffer (pfile, n)
* be identifier=definition.
*/
-static void
-make_definition (pfile, str)
+void
+cpp_define (pfile, str)
cpp_reader *pfile;
U_CHAR *str;
{
@@ -2479,9 +2478,8 @@ special_symbol (hp, pfile)
case T_SPECLINE:
{
- long line = CPP_BUFFER (pfile)->lineno;
- long col = CPP_BUFFER (pfile)->colno;
- cpp_buffer *ip = CPP_BUFFER (pfile);
+ long line = ip->lineno;
+ long col = ip->colno;
adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col);
buf = (char *) alloca (10);
@@ -5223,7 +5221,7 @@ cpp_get_token (pfile)
unneeded extra spaces (for the sake of cpp-using tools like
imake). Here we remove the space if it is safe to do so. */
if (pfile->buffer->rlimit - pfile->buffer->cur >= 2
- && pfile->buffer->cur[-1] == ' ')
+ && pfile->buffer->rlimit[-1] == ' ')
{
int c1 = pfile->buffer->rlimit[-2];
int c2 = CPP_BUF_PEEK (CPP_PREV_BUFFER (CPP_BUFFER (pfile)));
@@ -5807,7 +5805,7 @@ push_parse_file (pfile, fname)
*p++= 0;
if (opts->debug_output)
output_line_command (pfile, 0, same_file);
- make_definition (pfile, q);
+ cpp_define (pfile, q);
while (*p == ' ' || *p == '\t')
p++;
} else if (p[0] == '-' && p[1] == 'A') {
@@ -5880,7 +5878,7 @@ push_parse_file (pfile, fname)
case 'D':
if (opts->debug_output)
output_line_command (pfile, 0, same_file);
- make_definition (pfile, pend->arg);
+ cpp_define (pfile, pend->arg);
break;
case 'A':
make_assertion (pfile, "-A", pend->arg);