summaryrefslogtreecommitdiff
path: root/libreoffice/bison.patch
blob: b60b99a6c6c84873d3df19676bcb6c8a730c2201 (plain)
    1 From 45227d9b79dc4f2a2aa6874cd4e3c02b7934b197 Mon Sep 17 00:00:00 2001
    2 From: Stephan Bergmann <sbergman@redhat.com>
    3 Date: Tue, 14 Sep 2021 12:20:48 +0200
    4 Subject: Adapt to Bison 3.8 internal yyn -> yyrule rename
    5 
    6 see
    7 <https://git.savannah.gnu.org/cgit/bison.git/commit/?id=f30067ed51f23802fc91761ede1506dfa72b2865>
    8 "glr2.cc: log the execution of deferred actions" including "Rename argument yyn
    9 as yyrule for clarity."
   10 
   11 YYBISON was defined as 1 rather than as a representation of the Bison version
   12 prior to
   13 <https://git.savannah.gnu.org/cgit/bison.git/commit/?id=21c147b6e5372563b7c4741deadaddb9354f4b09>
   14 "yacc.c: provide the Bison version as an integral macro", which shouldn't be a
   15 problem here.  And YYBISON is apparently completely undefined with
   16 /usr/bin/bison on macOS.
   17 
   18 (The preceding comment always mentioned "yyi" and "yyrmap" in apparent mismatch
   19 with the actually used "yyn" and "yyr1" ever since
   20 c25ec0608a167bcf1d891043f02273761c351701 "initial import", so just leave it
   21 untouched.)
   22 
   23 Change-Id: I4f901407aa21ed4abec84e661d813ee7599f02f0
   24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122082
   25 Tested-by: Jenkins
   26 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
   27 ---
   28  connectivity/source/parse/sqlbison.y | 6 ++++++
   29  1 file changed, 6 insertions(+)
   30 
   31 diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
   32 index d14f36e7794f..c4be0bc00bd0 100644
   33 --- a/connectivity/source/parse/sqlbison.y
   34 +++ b/connectivity/source/parse/sqlbison.y
   35 @@ -74,9 +74,15 @@ inline connectivity::OSQLInternalNode* newNode(const OUString& _newValue,
   36  
   37  // yyi is the internal number of the rule that is currently being reduced
   38  // This can be mapped to external rule number via the yyrmap.
   39 +#if defined YYBISON && YYBISON >= 30800
   40 +#define SQL_NEW_RULE 			newNode("", SQLNodeType::Rule, yyr1[yyrule])
   41 +#define SQL_NEW_LISTRULE 		newNode("", SQLNodeType::ListRule, yyr1[yyrule])
   42 +#define SQL_NEW_COMMALISTRULE   newNode("", SQLNodeType::CommaListRule, yyr1[yyrule])
   43 +#else
   44  #define SQL_NEW_RULE 			newNode("", SQLNodeType::Rule, yyr1[yyn])
   45  #define SQL_NEW_LISTRULE 		newNode("", SQLNodeType::ListRule, yyr1[yyn])
   46  #define SQL_NEW_COMMALISTRULE   newNode("", SQLNodeType::CommaListRule, yyr1[yyn])
   47 +#endif
   48  
   49  
   50  extern connectivity::OSQLParser* xxx_pGLOBAL_SQLPARSER;
   51 -- 
   52 cgit v1.2.1

Generated by cgit