From: Dmitry Shachnev Date: Sat, 28 Aug 2021 17:44:39 +0000 (+0100) Subject: let Bison generate the header directly X-Git-Tag: archive/raspbian/5.212.0_alpha4-13+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=705b7acddf29d869692269d2856935b33b63b931;p=qtwebkit-opensource-src.git let Bison generate the header directly Forwarded: https://github.com/qtwebkit/qtwebkit/pull/1012 Last-Update: 2020-08-04 Starting with Bison 3.7, the generated C++ file #include's the header by default, instead of duplicating it. So we should not delete it. Remove the code to add #ifdef guards to the header, since Bison adds them itself since version 2.6.3. Gbp-Pq: Name bison_3.7.diff --- diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl index 5d63b081..9435701c 100644 --- a/Source/WebCore/css/makegrammar.pl +++ b/Source/WebCore/css/makegrammar.pl @@ -73,25 +73,6 @@ if ($suffix eq ".y.in") { } my $fileBase = File::Spec->join($outputDir, $filename); -my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp"); +my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp"); push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives. system(@bisonCommand) == 0 or die; - -open HEADER, ">$fileBase.h" or die; -print HEADER << "EOF"; -#ifndef CSSGRAMMAR_H -#define CSSGRAMMAR_H -EOF - -open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die; -while () { - print HEADER; -} -close HPP; - -print HEADER "#endif\n"; -close HEADER; - -unlink("$fileBase.cpp.h"); -unlink("$fileBase.hpp"); -