From 6e9cce197d0915d58f8d0e7d0e1b88d695d64f29 Mon Sep 17 00:00:00 2001 From: Sergei Krivonos Date: Thu, 1 Aug 2013 22:01:26 +0300 Subject: [PATCH] Fixing compilability under VS 2012 --- CMakeLists.txt | 3 +++ src/lib/common/common.h | 10 ++++++---- src/lib/platform/CMSWindowsScreen.cpp | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c592fc30..b011bd0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,6 +294,9 @@ else (UNIX) endif() endif() + if (NOT (MSVC_VERSION LESS 1700)) + add_definitions(/D_ALLOW_KEYWORD_MACROS) + endif() endif() if (GAME_DEVICE_SUPPORT) diff --git a/src/lib/common/common.h b/src/lib/common/common.h index e8818ad7..9cbcca43 100644 --- a/src/lib/common/common.h +++ b/src/lib/common/common.h @@ -142,10 +142,12 @@ // we don't want to use NULL since it's old and nasty, so replace any // usages with nullptr (warning: this could break many things). // if not c++0x yet, future proof code by allowing use of nullptr -#ifdef nullptr -#define NULL nullptr -#else -#define nullptr NULL +#if !(defined(_MSC_VER) && _MSC_VER >= 1700) +# ifdef nullptr +# define NULL nullptr +# else +# define nullptr NULL +# endif #endif // make assert available since we use it a lot diff --git a/src/lib/platform/CMSWindowsScreen.cpp b/src/lib/platform/CMSWindowsScreen.cpp index 8a52375d..8c0489d9 100644 --- a/src/lib/platform/CMSWindowsScreen.cpp +++ b/src/lib/platform/CMSWindowsScreen.cpp @@ -37,7 +37,6 @@ #include "CArch.h" #include "CArchMiscWindows.h" #include -#include // // add backwards compatible multihead support (and suppress bogus warning).