From 768ce1a46f5f0eb50d504dafe712f8b05c15f758 Mon Sep 17 00:00:00 2001
From: mazmazz <mar.marcoz@outlook.com>
Date: Sun, 26 Aug 2018 14:20:41 -0400
Subject: [PATCH] Make SDL Mixer X win32-exclusive

---
 src/sdl/Makefile.cfg   | 4 ++++
 src/sdl/mixer_sound.c  | 6 +++++-
 src/sdl/sdl_sound.c    | 2 +-
 src/win32/Makefile.cfg | 2 +-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/sdl/Makefile.cfg b/src/sdl/Makefile.cfg
index 57d594835d..f78135396c 100644
--- a/src/sdl/Makefile.cfg
+++ b/src/sdl/Makefile.cfg
@@ -80,7 +80,11 @@ ifdef NOMIXER
 else
 	i_sound_o=$(OBJDIR)/mixer_sound.o
 	OPTS+=-DHAVE_MIXER
+ifdef MINGW
 	SDL_LDFLAGS+=-lSDL2_mixer_ext
+else
+	SDL_LDFLAGS+=-lSDL2_mixer
+endif
 endif
 
 ifdef SDL_TTF
diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index 182e46b9c6..f3be246a6a 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -20,7 +20,11 @@
 #pragma warning(default : 4214 4244)
 #endif
 
-#include "SDL2/SDL_mixer_ext.h"
+#ifdef _WIN32
+#include "SDL_mixer_ext.h"
+#else
+#include "SDL_mixer.h"
+#endif
 
 /* This is the version number macro for the current SDL_mixer version: */
 #ifndef SDL_MIXER_COMPILEDVERSION
diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c
index 96f3b0ca63..8da0d2a85c 100644
--- a/src/sdl/sdl_sound.c
+++ b/src/sdl/sdl_sound.c
@@ -32,7 +32,7 @@
 #endif
 
 #ifdef HAVE_MIXER
-#include <SDL2/SDL_mixer_ext.h>
+#include <SDL_mixer.h>
 /* This is the version number macro for the current SDL_mixer version: */
 #ifndef SDL_MIXER_COMPILEDVERSION
 #define SDL_MIXER_COMPILEDVERSION \
diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg
index d5d1b35778..05be6bd7fe 100644
--- a/src/win32/Makefile.cfg
+++ b/src/win32/Makefile.cfg
@@ -15,7 +15,7 @@ else
 	HAVE_LIBGME=1
 	LIBGME_CFLAGS=-I../libs/gme/include
 	LIBGME_LDFLAGS=-L../libs/gme/win32 -lgme
-	SDL_CFLAGS?=-I../libs/SDL2/i686-w64-mingw32/include/SDL2 -I../libs/SDLMixerX/i686-w64-mingw32/include -Dmain=SDL_main
+	SDL_CFLAGS?=-I../libs/SDL2/i686-w64-mingw32/include/SDL2 -I../libs/SDLMixerX/i686-w64-mingw32/include/SDL2 -Dmain=SDL_main
 	SDL_LDFLAGS?=-L../libs/SDL2/i686-w64-mingw32/lib -L../libs/SDLMixerX/i686-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
 endif
 
-- 
GitLab