Address compiler compatibility code review.

This commit is contained in:
Brendan Dougherty 2023-07-12 18:30:55 -05:00
parent 7703b56374
commit e1d0500c70
5 changed files with 16 additions and 22 deletions

View File

@ -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()

View File

@ -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

View File

@ -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.

View File

@ -5,7 +5,7 @@
#include "mxcriticalsection.h"
#include "mxtypes.h"
#include "stlcompat.h"
#include "compat.h"
class MxNotification
{

View File

@ -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