summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-20 01:02:22 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-20 01:02:22 +0300
commit132ee3146d10b6e6a860bfd7e03b5a8667f2a44b (patch)
tree0ef5bab643e4571ca77f4b4fa53276410edc0af2 /src
parent5d8285ae8d16b40cf842f2bafd41978e316ac9b8 (diff)
downloadmv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.gz
mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.bz2
mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.xz
mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.zip
Prevent Wshadow varnings in SDL code.
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp3
-rw-r--r--src/actions/statusbar.cpp3
-rw-r--r--src/being/compoundsprite.cpp3
-rw-r--r--src/client.cpp9
-rw-r--r--src/defaults.cpp3
-rw-r--r--src/dirs.cpp3
-rw-r--r--src/dyetool/client.cpp9
-rw-r--r--src/dyetool/dyemain.cpp3
-rw-r--r--src/eventsmanager.h3
-rw-r--r--src/fs/paths.cpp3
-rw-r--r--src/fs/virtfs/fsdirrwops.cpp3
-rw-r--r--src/fs/virtfs/fsziprwops.cpp3
-rw-r--r--src/fs/virtfs/rwops.cpp3
-rw-r--r--src/fs/virtfs/virtfs1_unittest.cc3
-rw-r--r--src/fs/virtfs/zipreader.cpp3
-rw-r--r--src/game.h3
-rw-r--r--src/graphicsmanager.cpp6
-rw-r--r--src/graphicsmanager.h3
-rw-r--r--src/gui/fonts/font.h3
-rw-r--r--src/gui/fonts/textchunk.h3
-rw-r--r--src/gui/sdlinput.cpp3
-rw-r--r--src/gui/sdlinput.h3
-rw-r--r--src/gui/widgets/staticbrowserbox.cpp1
-rw-r--r--src/gui/windowmanager.cpp3
-rw-r--r--src/input/inputmanager.h3
-rw-r--r--src/input/joystick.cpp3
-rw-r--r--src/input/joystick.h3
-rw-r--r--src/input/keyboardconfig.h3
-rw-r--r--src/integrity_unittest.cc3
-rw-r--r--src/localconsts.h3
-rw-r--r--src/logger.h3
-rw-r--r--src/main.cpp3
-rw-r--r--src/maingui.cpp3
-rw-r--r--src/mumblemanager.cpp3
-rw-r--r--src/net/eathena/messagein.cpp3
-rw-r--r--src/net/sdltcpnet.h3
-rw-r--r--src/net/tmwa/messagein.cpp3
-rw-r--r--src/render/graphics.h3
-rw-r--r--src/render/mobileopengl2graphics.h3
-rw-r--r--src/render/mobileopenglgraphics.h3
-rw-r--r--src/render/modernopenglgraphics.h3
-rw-r--r--src/render/normalopenglgraphics.h3
-rw-r--r--src/render/nullopenglgraphics.h3
-rw-r--r--src/render/opengl/mgltypes.h3
-rw-r--r--src/render/safeopenglgraphics.h3
-rw-r--r--src/render/vertexes/openglgraphicsvertexes.h3
-rw-r--r--src/resources/atlas/atlasmanager.cpp3
-rw-r--r--src/resources/dye/dye.cpp3
-rw-r--r--src/resources/dye/dye_unittest.cc3
-rw-r--r--src/resources/dye/dyepalette.cpp3
-rw-r--r--src/resources/dye/dyepalette_replaceacolor.cpp3
-rw-r--r--src/resources/dye/dyepalette_replaceaoglcolor.cpp3
-rw-r--r--src/resources/dye/dyepalette_replacescolor.cpp3
-rw-r--r--src/resources/dye/dyepalette_replacesoglcolor.cpp3
-rw-r--r--src/resources/dye/dyepalette_unittest.cc3
-rw-r--r--src/resources/fboinfo.h3
-rw-r--r--src/resources/image/image.cpp3
-rw-r--r--src/resources/image/image.h6
-rw-r--r--src/resources/imagehelper.cpp3
-rw-r--r--src/resources/imagehelper.h3
-rw-r--r--src/resources/imagewriter.cpp3
-rw-r--r--src/resources/memorymanager.cpp3
-rw-r--r--src/resources/openglimagehelper.cpp3
-rw-r--r--src/resources/openglimagehelper.h3
-rw-r--r--src/resources/rect/doublerect.h3
-rw-r--r--src/resources/resourcemanager/resourcemanager.cpp4
-rw-r--r--src/resources/resourcemanager/resourcemanager_unittest.cc3
-rw-r--r--src/resources/safeopenglimagehelper.cpp3
-rw-r--r--src/resources/safeopenglimagehelper.h3
-rw-r--r--src/resources/screenshothelper.h3
-rw-r--r--src/resources/sdl2imagehelper.h3
-rw-r--r--src/resources/sdl2softwarescreenshothelper.cpp3
-rw-r--r--src/resources/sdlgfxblitfunc.cpp3
-rw-r--r--src/resources/sdlimagehelper.cpp6
-rw-r--r--src/resources/sdlimagehelper_unittest.cc3
-rw-r--r--src/resources/sdlmusic.h3
-rw-r--r--src/resources/sdlscreenshothelper.cpp3
-rw-r--r--src/resources/soundeffect.h3
-rw-r--r--src/resources/sprite/animatedsprite_unittest.cc3
-rw-r--r--src/sdl2gfx/SDL2_framerate.h3
-rw-r--r--src/sdl2gfx/SDL2_rotozoom.h3
-rw-r--r--src/soundmanager.cpp3
-rw-r--r--src/soundmanager.h3
-rw-r--r--src/test/testlauncher.cpp3
-rw-r--r--src/utils/buildhex.h3
-rw-r--r--src/utils/chatutils_unittest.cc3
-rw-r--r--src/utils/copynpaste.cpp9
-rw-r--r--src/utils/dumplibs.cpp4
-rw-r--r--src/utils/dumplibs_unittest.cc4
-rw-r--r--src/utils/process.cpp6
-rw-r--r--src/utils/sdl2helper.cpp3
-rw-r--r--src/utils/sdl2helper.h3
-rw-r--r--src/utils/sdlcheckutils.cpp3
-rw-r--r--src/utils/sdlhelper.cpp3
-rw-r--r--src/utils/sdlhelper.h3
-rw-r--r--src/utils/sdlpixel.h3
-rw-r--r--src/utils/sdlsharedhelper.cpp3
-rw-r--r--src/utils/timer.cpp3
98 files changed, 324 insertions, 1 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index e9bf8b110..7aa42d6eb 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -108,11 +108,14 @@
#include "utils/parameters.h"
#include "utils/timer.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef ANDROID
#ifndef USE_SDL2
#include <SDL_screenkeyboard.h>
#endif // USE_OPENGL
#endif // ANDROID
+#pragma GCC diagnostic pop
#include <sstream>
diff --git a/src/actions/statusbar.cpp b/src/actions/statusbar.cpp
index 1555c7233..5511876ad 100644
--- a/src/actions/statusbar.cpp
+++ b/src/actions/statusbar.cpp
@@ -39,11 +39,14 @@
#include "utils/gettext.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef ANDROID
#ifndef USE_SDL2
#include <SDL_screenkeyboard.h>
#endif // USE_SDL2
#endif // ANDROID
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp
index 7c313e51e..594c5ff2a 100644
--- a/src/being/compoundsprite.cpp
+++ b/src/being/compoundsprite.cpp
@@ -47,9 +47,12 @@
#include "utils/timer.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#endif // USE_SDL2
#include "debug.h"
diff --git a/src/client.cpp b/src/client.cpp
index 2bce1bad6..68fdeaca9 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -168,14 +168,20 @@
#endif // USE_OPENGL
#ifdef WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include "fs/specialfolder.h"
#undef ERROR
#endif // WIN32
#ifdef ANDROID
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_screenkeyboard.h>
+#pragma GCC diagnostic pop
#include <fstream>
#endif // USE_SDL2
#endif // ANDROID
@@ -186,11 +192,14 @@
#include "mumblemanager.h"
#endif // USE_MUMBLE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#include <SDL2_framerate.h>
#else // USE_SDL2
#include <SDL_framerate.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 3072a2b43..9d18e4bcf 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -39,7 +39,10 @@
#include "const/net/net.h"
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_keyboard.h>
+#pragma GCC diagnostic pop
#endif // USE_SDL2
#include "debug.h"
diff --git a/src/dirs.cpp b/src/dirs.cpp
index efde80ce9..6b6fe4a8c 100644
--- a/src/dirs.cpp
+++ b/src/dirs.cpp
@@ -53,7 +53,10 @@
#endif // __APPLE__
#ifdef WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include "fs/specialfolder.h"
#undef ERROR
#endif // WIN32
diff --git a/src/dyetool/client.cpp b/src/dyetool/client.cpp
index 0d01e17d4..912494b99 100644
--- a/src/dyetool/client.cpp
+++ b/src/dyetool/client.cpp
@@ -78,7 +78,10 @@
#include "net/ipc.h"
#ifdef WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include <sys/time.h>
#include "fs/specialfolder.h"
#undef ERROR
@@ -86,16 +89,22 @@
#ifdef ANDROID
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_screenkeyboard.h>
+#pragma GCC diagnostic pop
#include <fstream>
#endif // USE_SDL2
#endif // ANDROID
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#include <SDL2_framerate.h>
#else // USE_SDL2
#include <SDL_framerate.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/dyetool/dyemain.cpp b/src/dyetool/dyemain.cpp
index 11138e39a..f23019bef 100644
--- a/src/dyetool/dyemain.cpp
+++ b/src/dyetool/dyemain.cpp
@@ -44,7 +44,10 @@
#include "resources/sdlimagehelper.h"
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/eventsmanager.h b/src/eventsmanager.h
index 065fa78c2..63347e44f 100644
--- a/src/eventsmanager.h
+++ b/src/eventsmanager.h
@@ -23,7 +23,10 @@
#include "listeners/configlistener.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp
index a0165fc43..db16d5475 100644
--- a/src/fs/paths.cpp
+++ b/src/fs/paths.cpp
@@ -55,11 +55,14 @@
#include <pwd.h>
#endif // WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef ANDROID
#ifdef USE_SDL2
#include <SDL_system.h>
#endif // USE_SDL2
#endif // ANDROID
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/fs/virtfs/fsdirrwops.cpp b/src/fs/virtfs/fsdirrwops.cpp
index e77a4fc5f..14c6015f5 100644
--- a/src/fs/virtfs/fsdirrwops.cpp
+++ b/src/fs/virtfs/fsdirrwops.cpp
@@ -24,7 +24,10 @@
#include "fs/virtfs/file.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_rwops.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/fs/virtfs/fsziprwops.cpp b/src/fs/virtfs/fsziprwops.cpp
index 739ad4d3a..d744bdc73 100644
--- a/src/fs/virtfs/fsziprwops.cpp
+++ b/src/fs/virtfs/fsziprwops.cpp
@@ -25,7 +25,10 @@
#include "fs/virtfs/file.h"
#include "fs/virtfs/fsfuncs.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_rwops.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/fs/virtfs/rwops.cpp b/src/fs/virtfs/rwops.cpp
index e6ff601b3..03131e1db 100644
--- a/src/fs/virtfs/rwops.cpp
+++ b/src/fs/virtfs/rwops.cpp
@@ -52,7 +52,10 @@
#include "utils/fuzzer.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_rwops.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/fs/virtfs/virtfs1_unittest.cc b/src/fs/virtfs/virtfs1_unittest.cc
index 4bec32e5b..c5ca2736e 100644
--- a/src/fs/virtfs/virtfs1_unittest.cc
+++ b/src/fs/virtfs/virtfs1_unittest.cc
@@ -31,7 +31,10 @@
#include "utils/delete2.h"
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_rwops.h>
+#pragma GCC diagnostic pop
#ifndef UNITTESTS_CATCH
#include <algorithm>
diff --git a/src/fs/virtfs/zipreader.cpp b/src/fs/virtfs/zipreader.cpp
index c97b2ec61..4e81d24eb 100644
--- a/src/fs/virtfs/zipreader.cpp
+++ b/src/fs/virtfs/zipreader.cpp
@@ -29,7 +29,10 @@
#include "utils/stringutils.h"
#include <zlib.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_endian.h>
+#pragma GCC diagnostic pop
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#include <byteswap.h>
diff --git a/src/game.h b/src/game.h
index 50c52736a..5ce913ac5 100644
--- a/src/game.h
+++ b/src/game.h
@@ -29,7 +29,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
static const int MAX_LASTKEYS = 10;
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index dba9c7931..c49b97c59 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -29,7 +29,10 @@
#include <EGL/egl.h>
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_android.h>
+#pragma GCC diagnostic pop
#endif // USE_SDL2
#elif defined(__native_client__)
#include <GL/Regal.h>
@@ -90,7 +93,10 @@
#include "render/renderers.h"
#endif // USE_OPENGL
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/graphicsmanager.h b/src/graphicsmanager.h
index 6e1bacd99..82ccfe193 100644
--- a/src/graphicsmanager.h
+++ b/src/graphicsmanager.h
@@ -29,7 +29,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
// hack to hide warnings
#undef GL_GLEXT_VERSION
#undef GL_GLEXT_PROTOTYPES
diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h
index 71661b494..053167158 100644
--- a/src/gui/fonts/font.h
+++ b/src/gui/fonts/font.h
@@ -69,7 +69,10 @@
#include "gui/fonts/textchunklist.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_ttf.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/gui/fonts/textchunk.h b/src/gui/fonts/textchunk.h
index 7d0a9b2e4..2fe8c7adc 100644
--- a/src/gui/fonts/textchunk.h
+++ b/src/gui/fonts/textchunk.h
@@ -28,7 +28,10 @@
#include <string>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_ttf.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index a6a3b831c..e74db48ca 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -84,7 +84,10 @@
#include "render/graphics.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_timer.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h
index 573dc3fd2..4ec2ee9bb 100644
--- a/src/gui/sdlinput.h
+++ b/src/gui/sdlinput.h
@@ -82,7 +82,10 @@
#include "input/keyinput.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
#ifdef USE_SDL2
#include "sdlshared.h"
diff --git a/src/gui/widgets/staticbrowserbox.cpp b/src/gui/widgets/staticbrowserbox.cpp
index 36685ca8c..7a64dd060 100644
--- a/src/gui/widgets/staticbrowserbox.cpp
+++ b/src/gui/widgets/staticbrowserbox.cpp
@@ -45,7 +45,6 @@
#include "utils/browserboxtools.h"
#include "utils/checkutils.h"
#include "utils/stringutils.h"
-#include "utils/timer.h"
#include "utils/translation/podict.h"
#include <algorithm>
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp
index c683a6f77..c0336b7e3 100644
--- a/src/gui/windowmanager.cpp
+++ b/src/gui/windowmanager.cpp
@@ -65,6 +65,8 @@
#include "utils/naclmessages.h"
#endif // __native_client__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef ANDROID
#ifndef USE_SDL2
#include <SDL_screenkeyboard.h>
@@ -82,6 +84,7 @@
#ifdef WIN32
#include <SDL_syswm.h>
#endif // WIN32
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h
index 8455ef9b0..f6627884e 100644
--- a/src/input/inputmanager.h
+++ b/src/input/inputmanager.h
@@ -29,7 +29,10 @@
#include <list>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
class Setup_Input;
diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp
index 3ec317c8d..65f967838 100644
--- a/src/input/joystick.cpp
+++ b/src/input/joystick.cpp
@@ -31,7 +31,10 @@
#include "utils/timer.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/input/joystick.h b/src/input/joystick.h
index 4088cc84c..19f028491 100644
--- a/src/input/joystick.h
+++ b/src/input/joystick.h
@@ -25,7 +25,10 @@
#include "events/inputevent.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
class Joystick final
{
diff --git a/src/input/keyboardconfig.h b/src/input/keyboardconfig.h
index 789f8b4ef..c4fce5d17 100644
--- a/src/input/keyboardconfig.h
+++ b/src/input/keyboardconfig.h
@@ -25,7 +25,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
#include "sdlshared.h"
diff --git a/src/integrity_unittest.cc b/src/integrity_unittest.cc
index 381d1703a..198fc8c48 100644
--- a/src/integrity_unittest.cc
+++ b/src/integrity_unittest.cc
@@ -49,7 +49,10 @@
#include "utils/env.h"
#include "utils/delete2.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
+#pragma GCC diagnostic pop
#ifndef UNITTESTS_CATCH
#include <algorithm>
diff --git a/src/localconsts.h b/src/localconsts.h
index cea4d45f6..843e694da 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -320,7 +320,10 @@
PRAGMA45(GCC diagnostic push)
PRAGMA45(GCC diagnostic ignored "-Wswitch-default")
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_version.h>
+#pragma GCC diagnostic pop
#ifdef USE_SDL2
PRAGMA45(GCC diagnostic pop)
#endif // USE_SDL2
diff --git a/src/logger.h b/src/logger.h
index 117050272..a05105b01 100644
--- a/src/logger.h
+++ b/src/logger.h
@@ -25,7 +25,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_mutex.h>
+#pragma GCC diagnostic pop
#include <fstream>
#include <vector>
diff --git a/src/main.cpp b/src/main.cpp
index 8c6b3377a..951e6caac 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,7 +23,10 @@
#include "maingui.h"
#ifdef WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
#endif // WIN32
#include "debug.h"
diff --git a/src/maingui.cpp b/src/maingui.cpp
index 4561fd427..b2b8dd685 100644
--- a/src/maingui.cpp
+++ b/src/maingui.cpp
@@ -41,8 +41,11 @@
#include <iostream>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
#include <SDL_mixer.h>
+#pragma GCC diagnostic pop
#ifndef SDL_VERSIONNUM
#error missing <SDL_version.h>
diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp
index e4087e6ee..27aed89e6 100644
--- a/src/mumblemanager.cpp
+++ b/src/mumblemanager.cpp
@@ -26,7 +26,10 @@
#include <unistd.h>
#include <sys/types.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#ifndef WIN32
#include <sys/mman.h>
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index c6512bb4c..d472f8d92 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -29,9 +29,12 @@
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h
index 4730858e7..65433d0d4 100644
--- a/src/net/sdltcpnet.h
+++ b/src/net/sdltcpnet.h
@@ -23,7 +23,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_net.h>
+#pragma GCC diagnostic pop
namespace TcpNet
{
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index 612f943be..a689046fb 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -29,9 +29,12 @@
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/render/graphics.h b/src/render/graphics.h
index d0fabb997..5311c7bc6 100644
--- a/src/render/graphics.h
+++ b/src/render/graphics.h
@@ -75,11 +75,14 @@
#include "resources/mstack.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#include <SDL_render.h>
#else // USE_SDL2
#include <SDL_video.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/render/mobileopengl2graphics.h b/src/render/mobileopengl2graphics.h
index 3b88d1f93..b5490df84 100644
--- a/src/render/mobileopengl2graphics.h
+++ b/src/render/mobileopengl2graphics.h
@@ -39,7 +39,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h
index 19055119d..cdec3a0a5 100644
--- a/src/render/mobileopenglgraphics.h
+++ b/src/render/mobileopenglgraphics.h
@@ -39,7 +39,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h
index f0fe630a6..e13925234 100644
--- a/src/render/modernopenglgraphics.h
+++ b/src/render/modernopenglgraphics.h
@@ -39,7 +39,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h
index d32ae57e6..92422590f 100644
--- a/src/render/normalopenglgraphics.h
+++ b/src/render/normalopenglgraphics.h
@@ -39,7 +39,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h
index 78443de3c..e968b1a4e 100644
--- a/src/render/nullopenglgraphics.h
+++ b/src/render/nullopenglgraphics.h
@@ -39,7 +39,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/opengl/mgltypes.h b/src/render/opengl/mgltypes.h
index f55026859..84cea09d3 100644
--- a/src/render/opengl/mgltypes.h
+++ b/src/render/opengl/mgltypes.h
@@ -31,7 +31,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#ifdef __native_client__
#include <GL/Regal.h>
#else // __native_client__
diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h
index e1830832d..692b39600 100644
--- a/src/render/safeopenglgraphics.h
+++ b/src/render/safeopenglgraphics.h
@@ -36,7 +36,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/render/vertexes/openglgraphicsvertexes.h b/src/render/vertexes/openglgraphicsvertexes.h
index 646c29738..197b33584 100644
--- a/src/render/vertexes/openglgraphicsvertexes.h
+++ b/src/render/vertexes/openglgraphicsvertexes.h
@@ -29,7 +29,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#endif // ANDROID
#include <vector>
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp
index 10bc6136f..ea5126590 100644
--- a/src/resources/atlas/atlasmanager.cpp
+++ b/src/resources/atlas/atlasmanager.cpp
@@ -42,9 +42,12 @@
#include "resources/resourcemanager/resourcemanager.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "utils/checkutils.h"
diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp
index 70d2a21b1..cc597f9d5 100644
--- a/src/resources/dye/dye.cpp
+++ b/src/resources/dye/dye.cpp
@@ -30,9 +30,12 @@
#include <sstream>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/dye/dye_unittest.cc b/src/resources/dye/dye_unittest.cc
index 09b207371..8f6e75614 100644
--- a/src/resources/dye/dye_unittest.cc
+++ b/src/resources/dye/dye_unittest.cc
@@ -47,9 +47,12 @@
#include "utils/delete2.h"
#include "utils/env.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/dye/dyepalette.cpp b/src/resources/dye/dyepalette.cpp
index cf1d7c205..cf563d4e4 100644
--- a/src/resources/dye/dyepalette.cpp
+++ b/src/resources/dye/dyepalette.cpp
@@ -34,9 +34,12 @@
#include <cmath>
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#ifdef SIMD_SUPPORTED
#include "utils/cpu.h"
diff --git a/src/resources/dye/dyepalette_replaceacolor.cpp b/src/resources/dye/dyepalette_replaceacolor.cpp
index 21cd0b0c5..259bc6a71 100644
--- a/src/resources/dye/dyepalette_replaceacolor.cpp
+++ b/src/resources/dye/dyepalette_replaceacolor.cpp
@@ -22,9 +22,12 @@
#include "resources/dye/dyepalette.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#ifdef SIMD_SUPPORTED
// avx2
diff --git a/src/resources/dye/dyepalette_replaceaoglcolor.cpp b/src/resources/dye/dyepalette_replaceaoglcolor.cpp
index c0225df65..b0b2f5943 100644
--- a/src/resources/dye/dyepalette_replaceaoglcolor.cpp
+++ b/src/resources/dye/dyepalette_replaceaoglcolor.cpp
@@ -24,9 +24,12 @@
#include "resources/dye/dyepalette.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#ifdef SIMD_SUPPORTED
// avx2
diff --git a/src/resources/dye/dyepalette_replacescolor.cpp b/src/resources/dye/dyepalette_replacescolor.cpp
index 0a4206e83..4a8acdb5b 100644
--- a/src/resources/dye/dyepalette_replacescolor.cpp
+++ b/src/resources/dye/dyepalette_replacescolor.cpp
@@ -22,9 +22,12 @@
#include "resources/dye/dyepalette.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#ifdef SIMD_SUPPORTED
// avx2
diff --git a/src/resources/dye/dyepalette_replacesoglcolor.cpp b/src/resources/dye/dyepalette_replacesoglcolor.cpp
index cde7fac8e..7aec79cdb 100644
--- a/src/resources/dye/dyepalette_replacesoglcolor.cpp
+++ b/src/resources/dye/dyepalette_replacesoglcolor.cpp
@@ -24,9 +24,12 @@
#include "resources/dye/dyepalette.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#ifdef SIMD_SUPPORTED
// avx2
diff --git a/src/resources/dye/dyepalette_unittest.cc b/src/resources/dye/dyepalette_unittest.cc
index 351a74a2d..db82c4297 100644
--- a/src/resources/dye/dyepalette_unittest.cc
+++ b/src/resources/dye/dyepalette_unittest.cc
@@ -46,9 +46,12 @@
#include "utils/delete2.h"
#include "utils/env.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/fboinfo.h b/src/resources/fboinfo.h
index e92659156..452ea73ce 100644
--- a/src/resources/fboinfo.h
+++ b/src/resources/fboinfo.h
@@ -27,7 +27,10 @@
#include <GLES/gl.h>
#include <GLES/glext.h>
#else // ANDROID
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#if defined(__APPLE__)
#include <OpenGL/glext.h>
#elif !defined(__native_client__)
diff --git a/src/resources/image/image.cpp b/src/resources/image/image.cpp
index b1b23ce13..747609095 100644
--- a/src/resources/image/image.cpp
+++ b/src/resources/image/image.cpp
@@ -37,11 +37,14 @@
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#include <SDL2_rotozoom.h>
#else // USE_SDL2
#include <SDL_rotozoom.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/image/image.h b/src/resources/image/image.h
index 762f82fab..8657eee2c 100644
--- a/src/resources/image/image.h
+++ b/src/resources/image/image.h
@@ -37,15 +37,21 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#endif // ANDROID
#endif // USE_OPENGL
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#include <SDL_render.h>
#else // USE_SDL2
#include <SDL_video.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include <map>
diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp
index 1879e9a6a..bc5c36849 100644
--- a/src/resources/imagehelper.cpp
+++ b/src/resources/imagehelper.cpp
@@ -29,7 +29,10 @@
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h
index 9020e61b8..2af418704 100644
--- a/src/resources/imagehelper.h
+++ b/src/resources/imagehelper.h
@@ -27,7 +27,10 @@
#include "enums/render/rendertype.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
class Dye;
class Image;
diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp
index a797e2496..7347b98bf 100644
--- a/src/resources/imagewriter.cpp
+++ b/src/resources/imagewriter.cpp
@@ -25,7 +25,10 @@
#include "utils/checkutils.h"
#include <png.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/memorymanager.cpp b/src/resources/memorymanager.cpp
index 1e4b8b378..85f76df20 100644
--- a/src/resources/memorymanager.cpp
+++ b/src/resources/memorymanager.cpp
@@ -27,7 +27,10 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 66c60e039..468dbdfd8 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -46,7 +46,10 @@
#include "utils/checkutils.h"
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h
index 316ecb168..013c29866 100644
--- a/src/resources/openglimagehelper.h
+++ b/src/resources/openglimagehelper.h
@@ -41,7 +41,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#endif // ANDROID
class Dye;
diff --git a/src/resources/rect/doublerect.h b/src/resources/rect/doublerect.h
index 3919cc8e4..d3baafa61 100644
--- a/src/resources/rect/doublerect.h
+++ b/src/resources/rect/doublerect.h
@@ -23,7 +23,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
struct DoubleRect final
{
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp
index a60fea2a4..1343f3619 100644
--- a/src/resources/resourcemanager/resourcemanager.cpp
+++ b/src/resources/resourcemanager/resourcemanager.cpp
@@ -40,9 +40,13 @@
#include "resources/resourcetypes.h"
#endif // defined(DEBUG_DUMP_LEAKS) || defined(UNITTESTS)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_OPENGL
#include <SDL_image.h>
#endif // USE_OPENGL
+#pragma GCC diagnostic pop
+
#include <sstream>
#include <sys/time.h>
diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc
index fe3e2e995..eaa7c3797 100644
--- a/src/resources/resourcemanager/resourcemanager_unittest.cc
+++ b/src/resources/resourcemanager/resourcemanager_unittest.cc
@@ -40,9 +40,12 @@
#include <unistd.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp
index c1acea2f0..513b94427 100644
--- a/src/resources/safeopenglimagehelper.cpp
+++ b/src/resources/safeopenglimagehelper.cpp
@@ -42,7 +42,10 @@
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/safeopenglimagehelper.h b/src/resources/safeopenglimagehelper.h
index 25e9509a3..426279dcf 100644
--- a/src/resources/safeopenglimagehelper.h
+++ b/src/resources/safeopenglimagehelper.h
@@ -41,7 +41,10 @@
#ifndef USE_SDL2
#define GL_GLEXT_PROTOTYPES 1
#endif // USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_opengl.h>
+#pragma GCC diagnostic pop
#endif // ANDROID
class Dye;
diff --git a/src/resources/screenshothelper.h b/src/resources/screenshothelper.h
index cb4180147..51c881dd8 100644
--- a/src/resources/screenshothelper.h
+++ b/src/resources/screenshothelper.h
@@ -25,7 +25,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
class ScreenshotHelper notfinal
{
diff --git a/src/resources/sdl2imagehelper.h b/src/resources/sdl2imagehelper.h
index e1a9fce8b..fd25151a0 100644
--- a/src/resources/sdl2imagehelper.h
+++ b/src/resources/sdl2imagehelper.h
@@ -29,7 +29,10 @@
#include "resources/imagehelper.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
class Dye;
class Image;
diff --git a/src/resources/sdl2softwarescreenshothelper.cpp b/src/resources/sdl2softwarescreenshothelper.cpp
index 5bb3c3434..e510fa70e 100644
--- a/src/resources/sdl2softwarescreenshothelper.cpp
+++ b/src/resources/sdl2softwarescreenshothelper.cpp
@@ -28,9 +28,12 @@
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index e635c20d5..8b0500ec6 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -31,7 +31,10 @@ LGPL (c) A. Schiffler
#include "utils/checkutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_video.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 72afe3045..ca7b5b838 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -32,14 +32,20 @@
#include "utils/checkutils.h"
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#include "resources/sdlgfxblitfunc.h"
#else // SDL_BYTEORDER == SDL_LIL_ENDIAN
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_gfxBlitFunc.h>
+#pragma GCC diagnostic pop
#endif // SDL_BYTEORDER == SDL_LIL_ENDIAN
#ifndef SDL_BIG_ENDIAN
diff --git a/src/resources/sdlimagehelper_unittest.cc b/src/resources/sdlimagehelper_unittest.cc
index 2d4c52e73..ae796e90a 100644
--- a/src/resources/sdlimagehelper_unittest.cc
+++ b/src/resources/sdlimagehelper_unittest.cc
@@ -19,7 +19,10 @@
*/
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_endian.h>
+#pragma GCC diagnostic pop
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#include "test/unittests.h"
diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h
index 8db3fa74a..b90773d56 100644
--- a/src/resources/sdlmusic.h
+++ b/src/resources/sdlmusic.h
@@ -25,7 +25,10 @@
#include "resources/resource.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_mixer.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/resources/sdlscreenshothelper.cpp b/src/resources/sdlscreenshothelper.cpp
index 2fa9f3e2d..6cdb28878 100644
--- a/src/resources/sdlscreenshothelper.cpp
+++ b/src/resources/sdlscreenshothelper.cpp
@@ -26,9 +26,12 @@
#include "utils/sdlcheckutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h
index 429afc977..5623959a9 100644
--- a/src/resources/soundeffect.h
+++ b/src/resources/soundeffect.h
@@ -25,7 +25,10 @@
#include "resources/resource.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_mixer.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc
index ee36ed7d7..43e3e0614 100644
--- a/src/resources/sprite/animatedsprite_unittest.cc
+++ b/src/resources/sprite/animatedsprite_unittest.cc
@@ -49,9 +49,12 @@
#include "utils/delete2.h"
#include "utils/mrand.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/sdl2gfx/SDL2_framerate.h b/src/sdl2gfx/SDL2_framerate.h
index 45e153349..d39bd4bb3 100644
--- a/src/sdl2gfx/SDL2_framerate.h
+++ b/src/sdl2gfx/SDL2_framerate.h
@@ -38,7 +38,10 @@ extern "C"
/* --- */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
/* --------- Definitions */
diff --git a/src/sdl2gfx/SDL2_rotozoom.h b/src/sdl2gfx/SDL2_rotozoom.h
index 9a64d2a92..14cd90162 100644
--- a/src/sdl2gfx/SDL2_rotozoom.h
+++ b/src/sdl2gfx/SDL2_rotozoom.h
@@ -42,7 +42,10 @@ extern "C"
#define M_PI 3.1415926535897932384626433832795
#endif
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
/* ---- Defines */
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp
index 21cf9a528..6f587d755 100644
--- a/src/soundmanager.cpp
+++ b/src/soundmanager.cpp
@@ -38,7 +38,10 @@
#include "utils/checkutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/soundmanager.h b/src/soundmanager.h
index 7326efee6..2e039a3ed 100644
--- a/src/soundmanager.h
+++ b/src/soundmanager.h
@@ -29,7 +29,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_mixer.h>
+#pragma GCC diagnostic pop
class SDLMusic;
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 3dcda87e0..8d0cfa3a1 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -54,9 +54,12 @@
#include "resources/image/image.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL_gfxBlitFunc.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include <unistd.h>
diff --git a/src/utils/buildhex.h b/src/utils/buildhex.h
index ac9773070..cf9ab4591 100644
--- a/src/utils/buildhex.h
+++ b/src/utils/buildhex.h
@@ -23,9 +23,12 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef SDL_BIG_ENDIAN
#include <SDL_endian.h>
#endif // SDL_BYTEORDER
+#pragma GCC diagnostic pop
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define buildHex(a, b, c, d) \
diff --git a/src/utils/chatutils_unittest.cc b/src/utils/chatutils_unittest.cc
index d23e1331f..b6e735d75 100644
--- a/src/utils/chatutils_unittest.cc
+++ b/src/utils/chatutils_unittest.cc
@@ -46,9 +46,12 @@
#include "resources/resourcemanager/resourcemanager.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifndef USE_SDL2
#include <SDL.h>
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 8e3537734..0fdbf0652 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -38,7 +38,10 @@
#include "debug.h"
#ifdef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_clipboard.h>
+#pragma GCC diagnostic pop
#else // USE_SDL2
@@ -52,12 +55,18 @@
#include "utils/sdlhelper.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include <unistd.h>
#elif defined __native_client__
#include "utils/naclmessages.h"
#elif defined WIN32
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#endif // defined(__APPLE__)
#endif // USE_SDL2
diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp
index e08db3645..d1f87f987 100644
--- a/src/utils/dumplibs.cpp
+++ b/src/utils/dumplibs.cpp
@@ -25,6 +25,8 @@
#include "utils/stringutils.h"
#include <png.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
#include <SDL_mixer.h>
PRAGMACLANG6GCC(GCC diagnostic push)
@@ -32,6 +34,8 @@ PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include <SDL_net.h>
PRAGMACLANG6GCC(GCC diagnostic pop)
#include <SDL_ttf.h>
+#pragma GCC diagnostic pop
+
#include <zlib.h>
#include <curl/curl.h>
diff --git a/src/utils/dumplibs_unittest.cc b/src/utils/dumplibs_unittest.cc
index 66a272b8e..eb163aa7b 100644
--- a/src/utils/dumplibs_unittest.cc
+++ b/src/utils/dumplibs_unittest.cc
@@ -25,6 +25,8 @@
#include "utils/delete2.h"
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
#include <SDL_mixer.h>
PRAGMACLANG6GCC(GCC diagnostic push)
@@ -32,6 +34,8 @@ PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
#include <SDL_net.h>
PRAGMACLANG6GCC(GCC diagnostic pop)
#include <SDL_ttf.h>
+#pragma GCC diagnostic pop
+
#include <zlib.h>
#include "debug.h"
diff --git a/src/utils/process.cpp b/src/utils/process.cpp
index 56eaff27e..e79b8e3b7 100644
--- a/src/utils/process.cpp
+++ b/src/utils/process.cpp
@@ -24,11 +24,14 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#ifdef USE_SDL2
#ifdef ANDROID
#include <SDL_system.h>
#endif // ANDROID
#endif // USE_SDL2
+#pragma GCC diagnostic pop
#include "debug.h"
@@ -258,7 +261,10 @@ bool openBrowser(std::string url)
#elif defined ANDROID
#include "utils/stringutils.h"
#ifndef USE_SDL2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_screenkeyboard.h>
+#pragma GCC diagnostic pop
#endif // USE_SDL2
bool openBrowser(std::string url)
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp
index 6ed8e0984..97ff70f3a 100644
--- a/src/utils/sdl2helper.cpp
+++ b/src/utils/sdl2helper.cpp
@@ -26,7 +26,10 @@
#include "utils/stringutils.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/utils/sdl2helper.h b/src/utils/sdl2helper.h
index 5b95d6ebf..1d809a781 100644
--- a/src/utils/sdl2helper.h
+++ b/src/utils/sdl2helper.h
@@ -26,7 +26,10 @@
#include "localconsts.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_thread.h>
+#pragma GCC diagnostic pop
struct SDL_Surface;
struct SDL_SysWMinfo;
diff --git a/src/utils/sdlcheckutils.cpp b/src/utils/sdlcheckutils.cpp
index 1b622edde..86e5363b0 100644
--- a/src/utils/sdlcheckutils.cpp
+++ b/src/utils/sdlcheckutils.cpp
@@ -29,8 +29,11 @@
#include <map>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_image.h>
#include <SDL_ttf.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp
index 261c09026..58fa7f59b 100644
--- a/src/utils/sdlhelper.cpp
+++ b/src/utils/sdlhelper.cpp
@@ -30,8 +30,11 @@
#include "utils/glxhelper.h"
#endif // defined(USE_X11) && defined(USE_OPENGL)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_syswm.h>
#include <SDL_video.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/utils/sdlhelper.h b/src/utils/sdlhelper.h
index 831473adc..2e9f2930d 100644
--- a/src/utils/sdlhelper.h
+++ b/src/utils/sdlhelper.h
@@ -28,7 +28,10 @@ UTILS_SDL2HELPER_H
#else
#include "utils/stringvector.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_thread.h>
+#pragma GCC diagnostic pop
#include "localconsts.h"
diff --git a/src/utils/sdlpixel.h b/src/utils/sdlpixel.h
index 455702757..e2d3d3083 100644
--- a/src/utils/sdlpixel.h
+++ b/src/utils/sdlpixel.h
@@ -66,7 +66,10 @@
#include "gui/color.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL.h>
+#pragma GCC diagnostic pop
#ifndef SDL_BYTEORDER
#error missing SDL_endian.h
diff --git a/src/utils/sdlsharedhelper.cpp b/src/utils/sdlsharedhelper.cpp
index f3c1ace7d..a030c7a61 100644
--- a/src/utils/sdlsharedhelper.cpp
+++ b/src/utils/sdlsharedhelper.cpp
@@ -27,7 +27,10 @@
#include <ppapi_simple/ps.h>
#endif // __native_client__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_events.h>
+#pragma GCC diagnostic pop
#include "debug.h"
diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp
index 0233541e9..14c17adbc 100644
--- a/src/utils/timer.cpp
+++ b/src/utils/timer.cpp
@@ -22,7 +22,10 @@
#include "const/utils/timer.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow")
#include <SDL_timer.h>
+#pragma GCC diagnostic pop
#include <climits>