commit:     7c5b7e17bd7487c699cefc72339a7061f737ae81
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri May 21 22:06:23 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri May 21 22:06:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c5b7e17

games-emulation/snes9x: Fix building against GCC 11

Closes: https://bugs.gentoo.org/789963
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../snes9x/files/snes9x-1.60-gcc11.patch           | 31 ++++++++++++++++++++++
 games-emulation/snes9x/snes9x-1.60.ebuild          |  3 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/games-emulation/snes9x/files/snes9x-1.60-gcc11.patch 
b/games-emulation/snes9x/files/snes9x-1.60-gcc11.patch
new file mode 100644
index 00000000000..1b9a70b7f09
--- /dev/null
+++ b/games-emulation/snes9x/files/snes9x-1.60-gcc11.patch
@@ -0,0 +1,31 @@
+--- a/conffile.cpp
++++ b/conffile.cpp
+@@ -452,7 +452,7 @@
+     }
+ }
+ 
+-bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const 
ConfigEntry &a, const ConfigEntry &b) {
++bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const 
ConfigEntry &a, const ConfigEntry &b) const {
+       if(curConfigFile && a.section!=b.section){
+               const int sva = curConfigFile->GetSectionSize(a.section);
+               const int svb = curConfigFile->GetSectionSize(b.section);
+--- a/conffile.h
++++ b/conffile.h
+@@ -90,7 +90,7 @@
+               mutable bool used;
+ 
+         struct section_then_key_less {
+-            bool operator()(const ConfigEntry &a, const ConfigEntry &b);
++            bool operator()(const ConfigEntry &a, const ConfigEntry &b) const;
+         };
+ 
+         struct key_less {
+@@ -101,7 +101,7 @@
+         };
+ 
+         struct line_less {
+-            bool operator()(const ConfigEntry &a, const ConfigEntry &b){
++            bool operator()(const ConfigEntry &a, const ConfigEntry &b) const 
{
+                               if(a.line==b.line) return (b.val.empty() && 
!a.val.empty()) || a.key<b.key;
+                 if(b.line<0) return true;
+                 if(a.line<0) return false;

diff --git a/games-emulation/snes9x/snes9x-1.60.ebuild 
b/games-emulation/snes9x/snes9x-1.60.ebuild
index 14b09f9d754..b44ac4ece5b 100644
--- a/games-emulation/snes9x/snes9x-1.60.ebuild
+++ b/games-emulation/snes9x/snes9x-1.60.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -50,6 +50,7 @@ S="${WORKDIR}/${P}/unix"
 PATCHES=(
        "${FILESDIR}"/${PN}-1.53-cross-compile.patch
        "${FILESDIR}"/${PN}-1.59-build-system.patch
+       "${FILESDIR}"/${PN}-1.60-gcc11.patch
 )
 
 src_prepare() {

Reply via email to