1From d92b11fea65364fefa700249bd3340e0cd4c5b31 Mon Sep 17 00:00:00 2001 2From: Dmitry Shachnev <mitya57@gmail.com> 3Date: Tue, 4 Aug 2020 21:04:06 +0300 4Subject: [PATCH] Let Bison generate the header directly, to fix build with 5 Bison 3.7 6 7Starting with Bison 3.7, the generated C++ file #include's the header 8by default, instead of duplicating it. So we should not delete it. 9 10Remove the code to add #ifdef guards to the header, since Bison adds 11them itself since version 2.6.3. 12 13Found at [1] 14 15[1] https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31 16 17Upstream-Status: Pending 18Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 19--- 20 Source/WebCore/css/makegrammar.pl | 21 +-------------------- 21 1 file changed, 1 insertion(+), 20 deletions(-) 22 23diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl 24index 5d63b08102eb..9435701c7061 100644 25--- a/Source/WebCore/css/makegrammar.pl 26+++ b/Source/WebCore/css/makegrammar.pl 27@@ -73,25 +73,6 @@ 28 } 29 30 my $fileBase = File::Spec->join($outputDir, $filename); 31-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp"); 32+my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp"); 33 push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives. 34 system(@bisonCommand) == 0 or die; 35- 36-open HEADER, ">$fileBase.h" or die; 37-print HEADER << "EOF"; 38-#ifndef CSSGRAMMAR_H 39-#define CSSGRAMMAR_H 40-EOF 41- 42-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die; 43-while (<HPP>) { 44- print HEADER; 45-} 46-close HPP; 47- 48-print HEADER "#endif\n"; 49-close HEADER; 50- 51-unlink("$fileBase.cpp.h"); 52-unlink("$fileBase.hpp"); 53- 54