94084c
commit 41fddc064ded5c9a36d8ffaad59a85407a22a535
94084c
Author: Andrea Monaco <andrea.monaco@autistici.org>
94084c
Date:   Sun Dec 12 10:24:28 2021 +0100
94084c
94084c
    intl/plural.y: Avoid conflicting declarations of yyerror and yylex
94084c
    
94084c
    bison-3.8 includes these lines in the generated intl/plural.c:
94084c
    
94084c
      #if !defined __gettexterror && !defined YYERROR_IS_DECLARED
94084c
      void __gettexterror (struct parse_args *arg, const char *msg);
94084c
      #endif
94084c
      #if !defined __gettextlex && !defined YYLEX_IS_DECLARED
94084c
      int __gettextlex (YYSTYPE *yylvalp, struct parse_args *arg);
94084c
      #endif
94084c
    
94084c
    Those default prototypes provided by bison conflict with the
94084c
    declarations later on in plural.y.  This patch solves the issue.
94084c
    
94084c
    Reviewed-by: Arjun Shankar <arjun@redhat.com>
94084c
    (cherry picked from commit c6d7d6312c21bbcfb236d48bb7c11cedb234389f)
94084c
94084c
diff --git a/intl/plural.y b/intl/plural.y
94084c
index e02e74541c4574eb..2ee128ba01b5820d 100644
94084c
--- a/intl/plural.y
94084c
+++ b/intl/plural.y
94084c
@@ -40,6 +40,11 @@
94084c
 # define __gettextparse PLURAL_PARSE
94084c
 #endif
94084c
 
94084c
+/* Later we provide those prototypes.  Without these macros, bison may
94084c
+   generate its own prototypes with possible conflicts.  */
94084c
+#define YYLEX_IS_DECLARED
94084c
+#define YYERROR_IS_DECLARED
94084c
+
94084c
 %}
94084c
 %parse-param {struct parse_args *arg}
94084c
 %lex-param {struct parse_args *arg}