diff --git a/CMakeLists.txt b/CMakeLists.txt index 48daddd2..b758b843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8...3.5 FATAL_ERROR) project(isle CXX) option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) -option(BUILD_COMPAT "Compatibility for modern compilers" OFF) add_library(lego1 SHARED LEGO1/act1state.cpp @@ -227,7 +226,3 @@ if (MSVC) set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/incremental:no /debug") set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "/incremental:no") endif() - -if (BUILD_COMPAT) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"ISLE_COMPAT\"") -endif() diff --git a/LEGO1/compat.h b/LEGO1/compat.h index 496fa4db..d415fe1b 100644 --- a/LEGO1/compat.h +++ b/LEGO1/compat.h @@ -11,4 +11,17 @@ #define COMPAT_CONST #endif -#endif // ISLECOMPAT_H \ No newline at end of file +#define MSVC420_VERSION 1020 + +// STL compatibility. +#if defined(_MSC_VER) && (_MSC_VER <= MSVC420_VERSION) +#include +#else +#include +#include +using namespace std; +template +using List = list; +#endif + +#endif // ISLECOMPAT_H diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp index 66034563..3ed34f2f 100644 --- a/LEGO1/mxnotificationmanager.cpp +++ b/LEGO1/mxnotificationmanager.cpp @@ -5,8 +5,8 @@ #include "mxparam.h" #include "mxtypes.h" +#include "compat.h" #include "decomp.h" -#include "stlcompat.h" DECOMP_SIZE_ASSERT(MxNotification, 0x8); // Can't use DECOMP_SIZE_ASSERT due to STL type size changes. diff --git a/LEGO1/mxnotificationmanager.h b/LEGO1/mxnotificationmanager.h index 06c11dc8..e313510b 100644 --- a/LEGO1/mxnotificationmanager.h +++ b/LEGO1/mxnotificationmanager.h @@ -5,7 +5,7 @@ #include "mxcriticalsection.h" #include "mxtypes.h" -#include "stlcompat.h" +#include "compat.h" class MxNotification { diff --git a/LEGO1/stlcompat.h b/LEGO1/stlcompat.h deleted file mode 100644 index 5607590f..00000000 --- a/LEGO1/stlcompat.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef STLCOMPAT_H -#define STLCOMPAT_H - -#ifndef ISLE_COMPAT -#include -#else -#include -#include -using namespace std; -template -using List = list; -#endif - -#endif // STLCOMPAT_H