From 2eb72e76663a00f1f61cef513c31508d8d3236c2 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 12 Aug 2025 19:18:25 +0200 Subject: [PATCH] package/prboom: fix build w/ gcc-15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch force the usage of `-std=gnu18` for GCC15 toolchains to fix the following issues: - The boolean issue with C23 ``` In file included from ../../src/i_sound.h:38, from i_sound.c:58: ../../src/doomtype.h:48:15: error: cannot use keyword ‘false’ as enumeration constant 48 | typedef enum {false, true} boolean; | ^~~~~ ../../src/doomtype.h:48:15: note: ‘false’ is a keyword with ‘-std=c23’ onwards ``` - The usage of `usleep` & `struct timezone` require usage of GNU extensions. ``` i_system.c:58:3: error: implicit declaration of function ‘usleep’; did you mean ‘sleep’? [-Wimplicit-function-declaration] 58 | usleep(usecs); | ^~~~~~ | sleep i_system.c: In function ‘I_GetTime_RealTime’: i_system.c:78:19: error: storage size of ‘tz’ isn’t known 78 | struct timezone tz; | ^~ i_system.c: In function ‘I_GetRandomTimeSeed’: i_system.c:105:19: error: storage size of ‘tz’ isn’t known 105 | struct timezone tz; | ^~ ``` Signed-off-by: Thomas Perale Signed-off-by: Thomas Petazzoni --- package/prboom/prboom.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/prboom/prboom.mk b/package/prboom/prboom.mk index fc440e5cf8..ab9ab09913 100644 --- a/package/prboom/prboom.mk +++ b/package/prboom/prboom.mk @@ -18,6 +18,10 @@ ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y) PRBOOM_CFLAGS += -O0 endif +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_15),y) +PRBOOM_CFLAGS += -std=gnu18 +endif + PRBOOM_CONF_ENV += CFLAGS="$(PRBOOM_CFLAGS)" ifeq ($(BR2_PACKAGE_LIBPNG),y)