From 25a90c634d834ecdbd46620edfd42de8a2f6180c Mon Sep 17 00:00:00 2001 From: Eugene Kulabuhov Date: Sun, 24 Mar 2024 07:11:17 +0000 Subject: [PATCH] Fix SDL2 build on MacOS (#544) * Fix SDL2 build on MacOS * Fixing compilation error --- core/input_hw/input.c | 2 +- sdl/Makefile.sdl2 | 8 ++++++++ sdl/config.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/input_hw/input.c b/core/input_hw/input.c index 3c690d3..8f3e5a3 100644 --- a/core/input_hw/input.c +++ b/core/input_hw/input.c @@ -480,4 +480,4 @@ void input_end_frame(unsigned int cycles) } } } -} \ No newline at end of file +} diff --git a/sdl/Makefile.sdl2 b/sdl/Makefile.sdl2 index 1f27f34..b30d548 100644 --- a/sdl/Makefile.sdl2 +++ b/sdl/Makefile.sdl2 @@ -41,6 +41,14 @@ ifneq ($(OS),Windows_NT) DEFINES += -DHAVE_ALLOCA_H endif +ifneq ($(findstring Darwin,$(shell uname -a)),) + platform = osx +endif + +ifeq ($(platform), osx) + CFLAGS += -Winvalid-utf8 -Wstrict-prototypes +endif + SRCDIR = ../core INCLUDES = -I$(SRCDIR) -I$(SRCDIR)/z80 -I$(SRCDIR)/m68k -I$(SRCDIR)/sound -I$(SRCDIR)/input_hw -I$(SRCDIR)/cart_hw -I$(SRCDIR)/cart_hw/svp -I$(SRCDIR)/cd_hw -I$(SRCDIR)/ntsc -I$(SRCDIR)/tremor -I$(SRCDIR)/../sdl -I$(SRCDIR)/../sdl/sdl2 LIBS = `sdl2-config --libs` -lz -lm diff --git a/sdl/config.h b/sdl/config.h index 6c01bd3..6243d43 100644 --- a/sdl/config.h +++ b/sdl/config.h @@ -2,7 +2,7 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#include "shared.h" +#include "types.h" /**************************************************************************** * Config Option