From 6d533f39776193296c325b6061e5a1696bf7b74b Mon Sep 17 00:00:00 2001 From: Brendan Dougherty Date: Tue, 11 Jul 2023 13:53:46 -0500 Subject: [PATCH] Add stlcompat.h so this can still be built on modern compilers, fix affected type size asserts. --- LEGO1/mxlist.cpp | 3 ++- LEGO1/mxlist.h | 5 ++--- LEGO1/mxnotificationmanager.cpp | 4 +++- LEGO1/stlcompat.h | 11 +++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 LEGO1/stlcompat.h diff --git a/LEGO1/mxlist.cpp b/LEGO1/mxlist.cpp index b9e67bc4..477a92b1 100644 --- a/LEGO1/mxlist.cpp +++ b/LEGO1/mxlist.cpp @@ -2,4 +2,5 @@ #include "decomp.h" -DECOMP_SIZE_ASSERT(MxList, 0xc); +// Can't use DECOMP_SIZE_ASSERT due to STL type size changes. +//DECOMP_SIZE_ASSERT(MxList, 0xc); diff --git a/LEGO1/mxlist.h b/LEGO1/mxlist.h index 59516b2a..c13c75ae 100644 --- a/LEGO1/mxlist.h +++ b/LEGO1/mxlist.h @@ -1,12 +1,11 @@ #ifndef MXLIST_H #define MXLIST_H +#include "stlcompat.h" #ifndef ISLE_COMPAT -#include #define LIST_T List #else -#include -#define LIST_T std::list +#define LIST_T list #endif template diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp index 85f5aec6..5eae8d27 100644 --- a/LEGO1/mxnotificationmanager.cpp +++ b/LEGO1/mxnotificationmanager.cpp @@ -7,9 +7,11 @@ #include "mxtypes.h" #include "decomp.h" +#include "stlcompat.h" DECOMP_SIZE_ASSERT(MxNotification, 0x8); -DECOMP_SIZE_ASSERT(MxNotificationManager, 0x40); +// Can't use DECOMP_SIZE_ASSERT due to STL type size changes. +//DECOMP_SIZE_ASSERT(MxNotificationManager, 0x40); // OFFSET: LEGO1 0x100ac220 MxNotification::MxNotification(MxCore *p_target, MxParam *p_param) diff --git a/LEGO1/stlcompat.h b/LEGO1/stlcompat.h new file mode 100644 index 00000000..7fae2769 --- /dev/null +++ b/LEGO1/stlcompat.h @@ -0,0 +1,11 @@ +#ifndef STLCOMPAT_H +#define STLCOMPAT_H + +#ifndef ISLE_COMPAT +#include +#else +#include +using namespace std; +#endif + +#endif // STLCOMPAT_H