commit:     92ba03cd5810614dd2175279b149858d4d1b5d5a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 13 15:31:20 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 13 17:13:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92ba03cd

games-util/antimicro: fix build with GCC 11

Comparing pointer with 0. Check the size of the underlying structure
instead.

Closes: https://bugs.gentoo.org/791145
Signed-off-by: Sam James <sam <AT> gentoo.org>

 games-util/antimicro/antimicro-2.23.ebuild                   |  1 +
 .../antimicro/files/antimicro-2.23-gcc11-ptr-compare.patch   | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/games-util/antimicro/antimicro-2.23.ebuild 
b/games-util/antimicro/antimicro-2.23.ebuild
index 1363ec031a9..965970f2d3b 100644
--- a/games-util/antimicro/antimicro-2.23.ebuild
+++ b/games-util/antimicro/antimicro-2.23.ebuild
@@ -32,6 +32,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-linking-errors.patch
        "${FILESDIR}"/${PN}-2.23-no-compress-man-page.patch
        "${FILESDIR}"/${PN}-2.23-SDL2-include.patch
+       "${FILESDIR}"/${PN}-2.23-gcc11-ptr-compare.patch
 )
 
 src_prepare() {

diff --git a/games-util/antimicro/files/antimicro-2.23-gcc11-ptr-compare.patch 
b/games-util/antimicro/files/antimicro-2.23-gcc11-ptr-compare.patch
new file mode 100644
index 00000000000..2ed157c1e84
--- /dev/null
+++ b/games-util/antimicro/files/antimicro-2.23-gcc11-ptr-compare.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/791145
+--- a/src/mainwindow.cpp
++++ b/src/mainwindow.cpp
+@@ -364,7 +364,7 @@ void MainWindow::makeJoystickTabs()
+         ui->tabWidget->addTab(tabwidget, joytabName);
+     }
+ 
+-    if (joysticks > 0)
++    if (joysticks->size() > 0)
+     {
+         ui->tabWidget->setCurrentIndex(0);
+         ui->stackedWidget->setCurrentIndex(1);

Reply via email to