mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 15:21:15 +00:00
Address compiler compatibility code review.
This commit is contained in:
parent
7703b56374
commit
e1d0500c70
@ -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()
|
||||
|
||||
@ -11,4 +11,17 @@
|
||||
#define COMPAT_CONST
|
||||
#endif
|
||||
|
||||
#endif // ISLECOMPAT_H
|
||||
#define MSVC420_VERSION 1020
|
||||
|
||||
// STL compatibility.
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= MSVC420_VERSION)
|
||||
#include <STL.H>
|
||||
#else
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
using namespace std;
|
||||
template <class T>
|
||||
using List = list<T>;
|
||||
#endif
|
||||
|
||||
#endif // ISLECOMPAT_H
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "mxcriticalsection.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
#include "stlcompat.h"
|
||||
#include "compat.h"
|
||||
|
||||
class MxNotification
|
||||
{
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
#ifndef STLCOMPAT_H
|
||||
#define STLCOMPAT_H
|
||||
|
||||
#ifndef ISLE_COMPAT
|
||||
#include <STL.H>
|
||||
#else
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
using namespace std;
|
||||
template <class T>
|
||||
using List = list<T>;
|
||||
#endif
|
||||
|
||||
#endif // STLCOMPAT_H
|
||||
Loading…
Reference in New Issue
Block a user