c, c++: provide a default definition for N_

In C/C++, N_ is a no-op.  Define it if the user didn't.
Suggested by Frank Heckenbach.
https://lists.gnu.org/r/bug-bison/2020-04/msg00010.html

* src/output.c (prepare_symbol_names): Rename has_translations as
has_translations_flag.
* data/skeletons/bison.m4 (b4_has_translations_if): New.
* data/skeletons/java.m4 (b4_trans): Use it.

* data/skeletons/glr.c, data/skeletons/lalr1.cc, data/skeletons/yacc.c
(N_): Provide a default definition.
This commit is contained in:
Akim Demaille
2020-04-20 07:32:53 +02:00
parent df373f1ea1
commit 81334eb5a0
6 changed files with 18 additions and 2 deletions

View File

@@ -523,6 +523,11 @@ m4_if(b4_prefix, [yy], [],
# define YY_(msgid) msgid
# endif
#endif
]b4_has_translations_if([
#ifndef N_
# define N_(Msgid) Msgid
#endif
])[
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS