From dda65b8fb01ac399af8fa44085db3cd9ab6cef2b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 Apr 2016 19:32:40 +0300 Subject: Add workaround for fix compilation warnings in SDL2. --- src/localconsts.h | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'src/localconsts.h') diff --git a/src/localconsts.h b/src/localconsts.h index 96943671e..4f5358763 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -18,21 +18,6 @@ * along with this program. If not, see . */ -#include - -#if SDL_VERSION_ATLEAST(2, 0, 0) -#ifndef USE_SDL2 -#warning using SDL2 headers but configure set to use SDL1.2 -#warning please add configure flag --with-sdl2 -#define USE_SDL2 -#endif -#else -#ifdef USE_SDL2 -#error using SDL1.2 headers but configure set to use SDL2 -#error please remove configure flag --with-sdl2 -#endif -#endif - #define CAST_8 static_cast #define CAST_S8 static_cast #define CAST_U8 static_cast @@ -237,6 +222,28 @@ #endif // ENABLE_CHECKS +#ifdef USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch-default" +#endif +#include +#ifdef USE_SDL2 +#pragma GCC diagnostic pop +#endif + +#if SDL_VERSION_ATLEAST(2, 0, 0) +#ifndef USE_SDL2 +#warning using SDL2 headers but configure set to use SDL1.2 +#warning please add configure flag --with-sdl2 +#define USE_SDL2 +#endif +#else +#ifdef USE_SDL2 +#error using SDL1.2 headers but configure set to use SDL2 +#error please remove configure flag --with-sdl2 +#endif +#endif + // #define DEBUG_CONFIG 1 // #define DEBUG_BIND_TEXTURE 1 // #define DISABLE_RESOURCE_CACHING 1 -- cgit v1.2.3-70-g09d2