summaryrefslogtreecommitdiff
path: root/gcc/tradcpp.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2001-10-30 04:43:03 +0000
committerZack Weinberg <zack@gcc.gnu.org>2001-10-30 04:43:03 +0000
commit79e2e1605ed490d653541cecbc9da3671a895b90 (patch)
treed270717c81142b7949de669e9c7af60208e669ea /gcc/tradcpp.c
parentbae5261adbac2ef2c69532d85da0a224dfc2650d (diff)
downloadgcc-79e2e1605ed490d653541cecbc9da3671a895b90.tar.gz
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
Diffstat (limited to 'gcc/tradcpp.c')
-rw-r--r--gcc/tradcpp.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c
index d4122c83fd9..730dfaa27cd 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);
}