From 9aa6c7a30e30598c5fa9d9d3f82f2c19294b98d6 Mon Sep 17 00:00:00 2001
From: mio <miyopan@e.email>
Date: Wed, 28 Aug 2024 02:25:34 +0000
Subject: [PATCH] community/lbreakouthd: fix build with gcc 14

---
 community/lbreakouthd/APKBUILD                |  2 ++
 .../gcc14-implicit-function-declaration.patch | 36 +++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 community/lbreakouthd/gcc14-implicit-function-declaration.patch

diff --git a/community/lbreakouthd/APKBUILD b/community/lbreakouthd/APKBUILD
index 004cf22e09f8..395c7fc42d5e 100644
--- a/community/lbreakouthd/APKBUILD
+++ b/community/lbreakouthd/APKBUILD
@@ -18,6 +18,7 @@ subpackages="$pkgname-lang $pkgname-data::noarch"
 source="https://sourceforge.net/projects/lgames/files/lbreakouthd/lbreakouthd-$pkgver.tar.gz
 	0001-fix-undeclared-uint.patch
 	format-security.patch
+	gcc14-implicit-function-declaration.patch
 	"
 options="!check" # No test suite
 
@@ -50,4 +51,5 @@ sha512sums="
 c3a51cd0c57c87133423912de2b4e9411bc8eff5220288d484851db30299cdfec8c6b044b90702896bbd374678da1cf6e663ab9a75555ff58323149b55169ec3  lbreakouthd-1.1.9.tar.gz
 4de6934a7840153354f54c5c6a9c14d22e3d5a76030cd33131c2511d97c363d73912d53d3581fd756ff42dec9c7d4e819056e5a2eee5d92064a88a9337abe5eb  0001-fix-undeclared-uint.patch
 1600c7cb2c655d775b08961e7752979367c218917f628682e598816e33233cea7c3450c6f03005186dc8f6411d256733da4ed93284d4517608db9167bd189ce5  format-security.patch
+f70dcddbd776e5fd37e2fd63f6fbbd35dde982e14e0fd03cdf02aa126e912965613701738bcf7da1427030d0e4e41c6c871b7fa7fdd066c9f64dc78518ff047c  gcc14-implicit-function-declaration.patch
 "
diff --git a/community/lbreakouthd/gcc14-implicit-function-declaration.patch b/community/lbreakouthd/gcc14-implicit-function-declaration.patch
new file mode 100644
index 000000000000..7a6c158112cd
--- /dev/null
+++ b/community/lbreakouthd/gcc14-implicit-function-declaration.patch
@@ -0,0 +1,36 @@
+Fix -Wimplicit-function-declaration error with gcc 14.
+
+````
+paddle.c: In function 'paddle_freeze':
+paddle.c:98:9: error: implicit declaration of function 'SDL_GetRelativeMouseState' [-Wimplicit-function-declaration]
+   98 |         SDL_GetRelativeMouseState( &freeze, &freeze );
+      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
+```
+
+```
+balls.c: In function 'ball_check_brick_reflection':
+balls.c:202:48: error: implicit declaration of function 'SDL_GetTicks' [-Wimplicit-function-declaration]
+  202 |                 b->paddle->last_ball_contact = SDL_GetTicks();
+      |                                                ^~~~~~~~~~~~
+````
+
+--- lbreakouthd-1.1.9-origin/libgame/balls.c
++++ lbreakouthd-1.1.9/libgame/balls.c
+@@ -15,6 +15,7 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
++#include <SDL2/SDL_timer.h>
+ #include "gamedefs.h"
+ #include "levels.h"
+ #include "paddle.h"
+--- lbreakouthd-1.1.9-origin/libgame/paddle.c
++++ lbreakouthd-1.1.9/libgame/paddle.c
+@@ -15,6 +15,7 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
++#include <SDL2/SDL_mouse.h>
+ #include "gamedefs.h"
+ #include "shots.h"
+ #include "paddle.h"
-- 
GitLab