diff --git a/Makefile b/Makefile index 6252664bde..1c7eb46016 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ INCLUDE_SCANINC_ARGS := $(INCLUDE_DIRS:%=-I %) O_LEVEL ?= 2 CPPFLAGS := $(INCLUDE_CPP_ARGS) -Wno-trigraphs -DMODERN=$(MODERN) ifeq ($(MODERN),0) - CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef + CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef -std=gnu89 CC1 := tools/agbcc/bin/agbcc$(EXE) override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O$(O_LEVEL) -fhex-asm -g LIBPATH := -L ../../tools/agbcc/lib diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index a4182c8889..a90771048d 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -170,7 +170,7 @@ struct SoundChannel struct MusicPlayerInfo; -#if !MODERN +#if __STDC_VERSION__ < 202311L typedef void (*MPlayFunc)(); #else typedef void (*MPlayFunc)(...); diff --git a/include/librfu.h b/include/librfu.h index 0bd4dc6c0d..8125d64043 100644 --- a/include/librfu.h +++ b/include/librfu.h @@ -316,7 +316,7 @@ struct STWIStatus u8 recoveryCount; u8 unk_16; u8 unk_17; -#if !MODERN +#if __STDC_VERSION__ < 202311L void (*callbackM)(); #else void (*callbackM)(...); diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 0426e6459c..5ae53ab4e3 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -7,7 +7,7 @@ static u16 handshake_wait(u16 slot); static void STWI_set_timer_in_RAM(u8 count); static void STWI_stop_timer_in_RAM(void); static void STWI_init_slave(void); -#if !MODERN +#if __STDC_VERSION__ < 202311L static void Callback_Dummy_M(int reqCommandId, int error, void (*callbackM)()); #else static void Callback_Dummy_M(int reqCommandId, int error, void (*callbackM)(...)); @@ -139,7 +139,7 @@ static void sio32intr_clock_master(void) } gSTWIStatus->sending = 0; if (gSTWIStatus->callbackM != NULL) -#if !MODERN +#if __STDC_VERSION__ < 202311L Callback_Dummy_M(gSTWIStatus->reqActiveCommand, gSTWIStatus->error, gSTWIStatus->callbackM); #else Callback_Dummy_M(gSTWIStatus->reqActiveCommand, gSTWIStatus->error, (void (*)(...))gSTWIStatus->callbackM); @@ -396,7 +396,7 @@ static void STWI_init_slave(void) } NAKED -#if !MODERN +#if __STDC_VERSION__ < 202311L static void Callback_Dummy_M(int reqCommandId, int error, void (*callbackM)()) #else static void Callback_Dummy_M(int reqCommandId, int error, void (*callbackM)(...)) diff --git a/src/m4a.c b/src/m4a.c index 1344f53080..2ad2261d08 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -283,7 +283,7 @@ void MPlayExtender(struct CgbChannel *cgbChans) soundInfo->ident++; -#if !MODERN +#if __STDC_VERSION__ < 202311L gMPlayJumpTable[8] = ply_memacc; gMPlayJumpTable[17] = ply_lfos; gMPlayJumpTable[19] = ply_mod; @@ -332,7 +332,7 @@ void MusicPlayerJumpTableCopy(void) void ClearChain(void *x) { -#if !MODERN +#if __STDC_VERSION__ < 202311L void (*func)(void *) = *(&gMPlayJumpTable[34]); #else void (*func)(...) = *(&gMPlayJumpTable[34]); @@ -342,7 +342,7 @@ void ClearChain(void *x) void Clear64byte(void *x) { -#if !MODERN +#if __STDC_VERSION__ < 202311L void (*func)(void *) = *(&gMPlayJumpTable[35]); #else void (*func)(...) = *(&gMPlayJumpTable[35]);