summaryrefslogtreecommitdiff
path: root/gcc/read-md.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:23:00 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:23:00 +0000
commit606cf8b8135748e961585af5572af62a9a0551f1 (patch)
tree91d59b44f33747a188102e54bc43cca44943e99a /gcc/read-md.h
parentac0640e5d6abc7229a7f88c18c415f4c6bcb8764 (diff)
downloadgcc-606cf8b8135748e961585af5572af62a9a0551f1.tar.gz
gcc/
* read-md.h (read_char): Increment read_md_lineno after reading '\n'. (unread_char): Decrement read_md_lineno after putting back '\n'. * read-md.c (fatal_with_file_and_line): Push back any characters that we decide not to add to the context. (read_skip_spaces): Don't increment read_md_lineno here. Avoid using fatal_expected_char in cases where '/' ends a line (for example). (read_name): Don't increment read_md_lineno here. (read_escape): Likewise. (read_quoted_string): Likewise. (read_braced_string): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160576 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/read-md.h')
-rw-r--r--gcc/read-md.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/read-md.h b/gcc/read-md.h
index 2edd3ce4c21..0ebebde057d 100644
--- a/gcc/read-md.h
+++ b/gcc/read-md.h
@@ -51,7 +51,12 @@ extern struct obstack string_obstack;
static inline int
read_char (void)
{
- return getc (read_md_file);
+ int ch;
+
+ ch = getc (read_md_file);
+ if (ch == '\n')
+ read_md_lineno++;
+ return ch;
}
/* Put back CH, which was the last character read from the MD file. */
@@ -59,6 +64,8 @@ read_char (void)
static inline void
unread_char (int ch)
{
+ if (ch == '\n')
+ read_md_lineno--;
ungetc (ch, read_md_file);
}