Commit 79e2e160 by Zack Weinberg Committed by Zack Weinberg

tradcpp.c: Include intl.h.

	* 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
parent bae5261a
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
......
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment