From 30edbd58ad1fb03358f6fb5251ed7106353bb82a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Oct 2017 05:24:42 +0300 Subject: Fix compilation with old SDL 2 versions. --- src/maingui.cpp | 2 ++ src/resources/sdlmusic.cpp | 3 ++- src/utils/sdl2musichelper.cpp | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/maingui.cpp b/src/maingui.cpp index f4d8d5f79..62aac8604 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -88,8 +88,10 @@ PRAGMA48(GCC diagnostic pop) SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, \ SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL) +#ifndef SDL_MIXER_VERSION_ATLEAST #define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \ (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) +#endif // SDL_MIXER_VERSION_ATLEAST #include "debug.h" diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index be363fc48..983fc55c2 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -28,9 +28,10 @@ #define SDL_MIXER_COMPILEDVERSION \ SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, \ SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL) - +#ifndef SDL_MIXER_VERSION_ATLEAST #define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \ (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) +#endif // SDL_MIXER_VERSION_ATLEAST #endif // USE_SDL2 SDLMusic::SDLMusic(Mix_Music *const music, diff --git a/src/utils/sdl2musichelper.cpp b/src/utils/sdl2musichelper.cpp index 300f79991..eb73b2214 100644 --- a/src/utils/sdl2musichelper.cpp +++ b/src/utils/sdl2musichelper.cpp @@ -24,6 +24,11 @@ #include "debug.h" +#ifndef SDL_MIXER_VERSION_ATLEAST +#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) \ + (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) +#endif // SDL_MIXER_VERSION_ATLEAST + int SDL::MixOpenAudio(const int frequency, const uint16_t format, const int nchannels, -- cgit v1.2.3-60-g2f50