summaryrefslogtreecommitdiff
path: root/intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch')
-rw-r--r--intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch b/intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch
new file mode 100644
index 0000000..4931c9e
--- /dev/null
+++ b/intl-plural.y-Avoid-conflicting-declarations-of-yyer.patch
@@ -0,0 +1,42 @@
+From c6d7d6312c21bbcfb236d48bb7c11cedb234389f Mon Sep 17 00:00:00 2001
+From: Andrea Monaco <andrea.monaco@autistici.org>
+Date: Sun, 12 Dec 2021 10:24:28 +0100
+Subject: [PATCH] intl/plural.y: Avoid conflicting declarations of yyerror and
+ yylex
+
+bison-3.8 includes these lines in the generated intl/plural.c:
+
+ #if !defined __gettexterror && !defined YYERROR_IS_DECLARED
+ void __gettexterror (struct parse_args *arg, const char *msg);
+ #endif
+ #if !defined __gettextlex && !defined YYLEX_IS_DECLARED
+ int __gettextlex (YYSTYPE *yylvalp, struct parse_args *arg);
+ #endif
+
+Those default prototypes provided by bison conflict with the
+declarations later on in plural.y. This patch solves the issue.
+
+Reviewed-by: Arjun Shankar <arjun@redhat.com>
+---
+ intl/plural.y | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/intl/plural.y b/intl/plural.y
+index e02e745..2ee128b 100644
+--- a/intl/plural.y
++++ b/intl/plural.y
+@@ -40,6 +40,11 @@
+ # define __gettextparse PLURAL_PARSE
+ #endif
+
++/* Later we provide those prototypes. Without these macros, bison may
++ generate its own prototypes with possible conflicts. */
++#define YYLEX_IS_DECLARED
++#define YYERROR_IS_DECLARED
++
+ %}
+ %parse-param {struct parse_args *arg}
+ %lex-param {struct parse_args *arg}
+--
+1.8.3.1
+