summaryrefslogtreecommitdiff
path: root/src/localconsts.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-28 19:32:40 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-28 20:26:00 +0300
commitdda65b8fb01ac399af8fa44085db3cd9ab6cef2b (patch)
treeb1ce9789df7284f3701c191f36ae50d1b60ea262 /src/localconsts.h
parentbab032c4999ab5a1c4da48c14c9a959c686f5da8 (diff)
downloadplus-dda65b8fb01ac399af8fa44085db3cd9ab6cef2b.tar.gz
plus-dda65b8fb01ac399af8fa44085db3cd9ab6cef2b.tar.bz2
plus-dda65b8fb01ac399af8fa44085db3cd9ab6cef2b.tar.xz
plus-dda65b8fb01ac399af8fa44085db3cd9ab6cef2b.zip
Add workaround for fix compilation warnings in SDL2.
Diffstat (limited to 'src/localconsts.h')
-rw-r--r--src/localconsts.h37
1 files changed, 22 insertions, 15 deletions
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 <http://www.gnu.org/licenses/>.
*/
-#include <SDL_version.h>
-
-#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<char>
#define CAST_S8 static_cast<int8_t>
#define CAST_U8 static_cast<uint8_t>
@@ -237,6 +222,28 @@
#endif // ENABLE_CHECKS
+#ifdef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wswitch-default"
+#endif
+#include <SDL_version.h>
+#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