summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-29 15:59:17 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-29 16:02:31 +0300
commit1c4ab54d2591c497a48df7f800510db356f5607b (patch)
tree40c2ea1c326bd77bcd37590932906531a85339e5 /src
parentd8e7f47c19fbfd598ba5da6c31369e6ff1aefc8e (diff)
downloadmanaplus-1c4ab54d2591c497a48df7f800510db356f5607b.tar.gz
manaplus-1c4ab54d2591c497a48df7f800510db356f5607b.tar.bz2
manaplus-1c4ab54d2591c497a48df7f800510db356f5607b.tar.xz
manaplus-1c4ab54d2591c497a48df7f800510db356f5607b.zip
move SDL2 preprocessor checks into localconsts.h
also allow use SDL2 on broken systems where SDL2 is used/stored as SDL1.2.
Diffstat (limited to 'src')
-rw-r--r--src/localconsts.h13
-rw-r--r--src/main.cpp10
2 files changed, 13 insertions, 10 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 9eb34c328..ead9eb459 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -18,6 +18,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#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
+
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef nullptr
#define nullptr 0
diff --git a/src/main.cpp b/src/main.cpp
index 89738fa93..79b435faa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -49,16 +49,6 @@
#include <SDL_version.h>
-#if SDL_VERSION_ATLEAST(2, 0, 0)
-#ifndef USE_SDL2
-#error using SDL2 headers but configure set to use SDL1.2
-#endif
-#else
-#ifdef USE_SDL2
-#error using SDL1.2 headers but configure set to use SDL2
-#endif
-#endif
-
#include "debug.h"
char *selfName = nullptr;