From 1c32e99d536fedf3769c026ed87ce50541b8a8a0 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 30 Oct 2001 04:43:03 +0000 Subject: [PATCH] * tradcpp.c: Include intl.h. Rename WARNING, ERROR, FATAL to MT_WARNING, MT_ERROR, MT_FATAL. (main): Call gcc_init_libintl. (v_message): Call gettext on msgid and "warning: " * tradcif.y: Include intl.h. (yyerror): Make parameter definition consistent with prototype. Call gettext on msgid argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46627 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/tradcif.y | 7 ++++--- gcc/tradcpp.c | 23 +++++++++++++---------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1f448b..54698ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-10-29 Zack Weinberg + + * tradcpp.c: Include intl.h. Rename WARNING, ERROR, FATAL to + MT_WARNING, MT_ERROR, MT_FATAL. + (main): Call gcc_init_libintl. + (v_message): Call gettext on msgid and "warning: " + * tradcif.y: Include intl.h. + (yyerror): Make parameter definition consistent with + prototype. Call gettext on msgid argument. + 2001-10-29 Kaveh R. Ghazi * combine.c (num_sign_bit_copies): Avoid signed/unsigned diff --git a/gcc/tradcif.y b/gcc/tradcif.y index 167a8db..7cedecc 100644 --- a/gcc/tradcif.y +++ b/gcc/tradcif.y @@ -24,6 +24,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ %{ #include "config.h" #include "system.h" +#include "intl.h" #include "tradcpp.h" #include @@ -533,10 +534,10 @@ parse_escape (string_ptr) } static void -yyerror (s) - const char *s; +yyerror (msgid) + const char *msgid; { - error ("%s", s); + error ("%s", _(msgid)); longjmp (parse_return_error, 1); } diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c index d4122c8..730dfaa 100644 --- a/gcc/tradcpp.c +++ b/gcc/tradcpp.c @@ -25,6 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "cppdefault.h" #include "tradcpp.h" #include "mkdeps.h" +#include "intl.h" typedef unsigned char U_CHAR; @@ -382,7 +383,7 @@ static int comp_def_part PARAMS ((int, const U_CHAR *, int, static void delete_macro PARAMS ((HASHNODE *)); /* First arg to v_message. */ -enum msgtype { WARNING = 0, ERROR, FATAL }; +enum msgtype { MT_WARNING = 0, MT_ERROR, MT_FATAL }; static void v_message PARAMS ((enum msgtype mtype, int line, const char *msgid, va_list ap)) ATTRIBUTE_PRINTF (3, 0); @@ -538,6 +539,8 @@ main (argc, argv) max_include_len = cpp_GCC_INCLUDE_DIR_len + 7; /* ??? */ + gcc_init_libintl (); + /* It's simplest to just create this struct whether or not it will be needed. */ deps = deps_init (); @@ -4654,7 +4657,7 @@ v_message (mtype, line, msgid, ap) const char *fname = 0; int i; - if (mtype == WARNING && inhibit_warnings) + if (mtype == MT_WARNING && inhibit_warnings) return; for (i = indepth; i >= 0; i--) @@ -4670,13 +4673,13 @@ v_message (mtype, line, msgid, ap) else fprintf (stderr, "%s: ", progname); - if (mtype == WARNING) - fputs ("warning: ", stderr); + if (mtype == MT_WARNING) + fputs (_("warning: "), stderr); - vfprintf (stderr, msgid, ap); + vfprintf (stderr, _(msgid), ap); putc ('\n', stderr); - if (mtype == ERROR) + if (mtype == MT_ERROR) errors++; } @@ -4689,7 +4692,7 @@ error VPARAMS ((const char *msgid, ...)) VA_OPEN(ap, msgid); VA_FIXEDARG (ap, const char *, msgid); - v_message (ERROR, 0, msgid, ap); + v_message (MT_ERROR, 0, msgid, ap); VA_CLOSE (ap); } @@ -4700,7 +4703,7 @@ error_with_line VPARAMS ((int line, const char *msgid, ...)) VA_FIXEDARG (ap, int, line); VA_FIXEDARG (ap, const char *, msgid); - v_message (ERROR, line, msgid, ap); + v_message (MT_ERROR, line, msgid, ap); VA_CLOSE (ap); } @@ -4719,7 +4722,7 @@ warning VPARAMS ((const char *msgid, ...)) VA_OPEN(ap, msgid); VA_FIXEDARG (ap, const char *, msgid); - v_message (WARNING, 0, msgid, ap); + v_message (MT_WARNING, 0, msgid, ap); VA_CLOSE (ap); } @@ -4729,7 +4732,7 @@ fatal VPARAMS ((const char *msgid, ...)) VA_OPEN(ap, msgid); VA_FIXEDARG (ap, const char *, msgid); - v_message (FATAL, 0, msgid, ap); + v_message (MT_FATAL, 0, msgid, ap); VA_CLOSE (ap); exit (FATAL_EXIT_CODE); } -- 2.7.4