From a1a4b7cfbf2dda7f86c72ada6d611738444726bf Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 1 May 2025 00:11:57 +0200 Subject: [PATCH] force c17 with gcc 15 for now dont feel like porting stuff over to c24 or whatever for v8 so just force c17 so ppl can still compile --- src/Makefile | 5 +++++ src/Makefile.cfg | 14 +++++++++++++- src/dehacked.c | 4 ---- src/info.c | 3 --- src/sdl/i_video.c | 3 ++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Makefile b/src/Makefile index 46b7993ac..2ebe5d2e7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -296,6 +296,11 @@ ifdef X86_64 endif endif +# we just force c17 for now with gcc15 +ifdef GCC150 + CFLAGS+=-std=gnu17 + CPPFLAGS+=-std=gnu17 +endif ifndef NOPNG OPTS+=-DHAVE_PNG diff --git a/src/Makefile.cfg b/src/Makefile.cfg index cba731b9c..e4ba0c1ab 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -12,6 +12,7 @@ # to avoid a false positive with the version detection... SUPPORTED_GCC_VERSIONS:=\ + 151 150 15\ 142 141 140 14\ 132 131 130 13\ 123 122 121 120 12\ @@ -78,6 +79,18 @@ ifeq (,$(filter GCC%,$(.VARIABLES))) endif endif +ifdef GCC151 +GCC150=1 +endif + +ifdef GCC15 +GCC150=1 +endif + +ifdef GCC150 +GCC142=1 +endif + ifdef GCC142 GCC141=1 endif @@ -469,7 +482,6 @@ ifdef GCC81 WFLAGS+=-Wno-error=multistatement-macros endif - #indicate platform and what interface use with ifndef LINUX ifndef FREEBSD diff --git a/src/dehacked.c b/src/dehacked.c index a453715a7..f0e2583d8 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1414,9 +1414,6 @@ static void readhuditem(MYFILE *f, INT32 num) // IMPORTANT! // DO NOT FORGET TO SYNC THIS LIST WITH THE ACTIONNUM ENUM IN INFO.H - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" actionpointer_t actionpointers[] = { {{A_Explode}, "A_EXPLODE"}, @@ -1625,7 +1622,6 @@ actionpointer_t actionpointers[] = // This NULL entry must be the last in the list {{NULL}, NULL}, }; -#pragma GCC diagnostic pop static void readframe(MYFILE *f, INT32 num) { diff --git a/src/info.c b/src/info.c index 19183de52..7afc76bf6 100644 --- a/src/info.c +++ b/src/info.c @@ -69,8 +69,6 @@ char sprnames[NUMSPRITES + 1][5] = }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" state_t states[NUMSTATES] = { // frame is masked through FF_FRAMEMASK @@ -3412,7 +3410,6 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif }; -#pragma GCC diagnostic pop mobjinfo_t mobjinfo[NUMMOBJTYPES] = { diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index aa291abb6..7504caa67 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -864,6 +864,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) { SDLforceUngrabMouse(); } + memset(gamekeydown, 0, NUMKEYS); // TODO this is a scary memset if (MOUSE_MENU) @@ -1903,7 +1904,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) // Some GPU drivers may give us a 16-bit depth buffer since the // default value for SDL_GL_DEPTH_SIZE is 16. SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); - + // request stencil buffer. If there are problems on weaker hw the bit count could be reduced // If only something like 1-bit or 2-bit stencil is available on some gpus then should implement limit for maxportals based on that. // 4 bits would be enough for current limit in maxportals (12)