tradcpp.c: Include intl.h.
authorZack Weinberg <zack@codesourcery.com>
Tue, 30 Oct 2001 04:43:03 +0000 (04:43 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Tue, 30 Oct 2001 04:43:03 +0000 (04:43 +0000)
* 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.

From-SVN: r46627

gcc/ChangeLog
gcc/tradcif.y
gcc/tradcpp.c

index a1f448bf18aabee19df482ba825f9fcde335f9e8..54698ba7d91978c09305dd4afd3b1c0f824b91ce 100644 (file)
@@ -1,3 +1,13 @@
+2001-10-29  Zack Weinberg  <zack@codesourcery.com>
+
+       * 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  <ghazi@caip.rutgers.edu>
 
        * combine.c (num_sign_bit_copies): Avoid signed/unsigned
index 167a8db900caffffb0abf7452143bac34007cd30..7cedecc2dafb1dedac78b398375d0d107bdae662 100644 (file)
@@ -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 <setjmp.h>
 
@@ -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);
 }
 \f
index d4122c83fd98716ec30a57d288cb669dbb299768..730dfaa27cd380347a6d37195ca0cb2ce7c9babb 100644 (file)
@@ -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);
 }