From d2f8cffa1d0ce734ce4a465bcef76f9c41748045 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Tue, 23 Jun 1998 13:51:33 +0000 Subject: [PATCH] cpplib.c (do_line): Typo broke #line directive. Tue Jun 23 16:44:21 1998 Dave Brolley * cpplib.c (do_line): Typo broke #line directive. (cpp_message_from_errno): New function. (cpp_error_from_errno): Call cpp_message_from_errno. * cpplib.h (cpp_message_from_errno): New function. From-SVN: r20675 --- gcc/ChangeLog | 7 +++++++ gcc/cpplib.c | 19 ++++++++++++++----- gcc/cpplib.h | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56642f343ad..928d7911606 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Tue Jun 23 16:44:21 1998 Dave Brolley + + * cpplib.c (do_line): Typo broke #line directive. + (cpp_message_from_errno): New function. + (cpp_error_from_errno): Call cpp_message_from_errno. + * cpplib.h (cpp_message_from_errno): New function. + Tue Jun 23 13:38:18 EDT 1998 Andrew MacLeod * libgcc2.c (__get_eh_table_version, __get_eh_table_language): New diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 0d71490d544..15cbf58ab79 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -3752,18 +3752,18 @@ do_line (pfile, keyword, unused1, unused2) } if (*p == '1') file_change = enter_file; - else if (*p == 2) + else if (*p == '2') file_change = leave_file; - else if (*p == 3) + else if (*p == '3') ip->system_header_p = 1; - else /* if (*p == 4) */ + else /* if (*p == '4') */ ip->system_header_p = 2; CPP_SET_WRITTEN (pfile, num_start); token = get_directive_token (pfile); p = pfile->token_buffer + num_start; if (token == CPP_NUMBER && p[1] == '\0' && (*p == '3' || *p== '4')) { - ip->system_header_p = *p == 3 ? 1 : 2; + ip->system_header_p = *p == '3' ? 1 : 2; token = get_directive_token (pfile); } if (token != CPP_VSPACE) { @@ -7648,6 +7648,15 @@ void cpp_error_from_errno (pfile, name) cpp_reader *pfile; const char *name; +{ + cpp_message_from_errno (pfile, 1, name); +} + +void +cpp_message_from_errno (pfile, is_error, name) + cpp_reader *pfile; + int is_error; + const char *name; { int e = errno; cpp_buffer *ip = cpp_file_buffer (pfile); @@ -7657,7 +7666,7 @@ cpp_error_from_errno (pfile, name) if (ip != NULL) cpp_file_line_for_message (pfile, ip->nominal_fname, ip->lineno, -1); - cpp_message (pfile, 1, "%s: %s", name, my_strerror (e)); + cpp_message (pfile, is_error, "%s: %s", name, my_strerror (e), ""); } void diff --git a/gcc/cpplib.h b/gcc/cpplib.h index e6a32954124..65cb5daff91 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -658,6 +658,7 @@ extern void cpp_pedwarn_with_line PVPROTO ((cpp_reader *, int, int, const char * ATTRIBUTE_PRINTF_4; extern void cpp_pedwarn_with_file_and_line PVPROTO ((cpp_reader *, char *, int, const char *, ...)) ATTRIBUTE_PRINTF_4; +extern void cpp_message_from_errno PROTO ((cpp_reader *, int, const char *)); extern void cpp_error_from_errno PROTO ((cpp_reader *, const char *)); extern void cpp_perror_with_name PROTO ((cpp_reader *, const char *)); extern void v_cpp_message PROTO ((cpp_reader *, int, const char *, va_list)); -- 2.30.2