Skip to content

Commit

Permalink
games-emulation/snes9x: Fix building against GCC 11
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/789963
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
SoapGentoo committed May 21, 2021
1 parent 955f7bd commit 7c5b7e1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions games-emulation/snes9x/files/snes9x-1.60-gcc11.patch
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion games-emulation/snes9x/snes9x-1.60.ebuild
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7c5b7e1

Please sign in to comment.