move override macro to compat.h

This commit is contained in:
itsmattkc 2023-07-12 14:12:03 -07:00
parent 67115e32d3
commit f707af34db
5 changed files with 15 additions and 9 deletions

View file

@ -11,4 +11,11 @@
#define COMPAT_CONST #define COMPAT_CONST
#endif #endif
// We use `override` so newer compilers can tell us our vtables are valid,
// however this keyword was added in C++11, so we define it as empty for
// compatibility with older compilers.
#if defined(_MSC_VER) && _MSC_VER <= 1200 // 1200 corresponds to VC6.0 but "override" was probably added even later
#define override
#endif
#endif // ISLECOMPAT_H #endif // ISLECOMPAT_H

View file

@ -1,6 +1,7 @@
#ifndef LEGOSTREAM_H #ifndef LEGOSTREAM_H
#define LEGOSTREAM_H #define LEGOSTREAM_H
#include "compat.h"
#include "decomp.h" #include "decomp.h"
#include "mxtypes.h" #include "mxtypes.h"

View file

@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include "compat.h"
#include "mxtypes.h" #include "mxtypes.h"
class MxParam; class MxParam;
@ -14,8 +15,8 @@ class MxCore
public: public:
__declspec(dllexport) MxCore(); __declspec(dllexport) MxCore();
__declspec(dllexport) virtual ~MxCore(); // vtable+00 __declspec(dllexport) virtual ~MxCore(); // vtable+00
__declspec(dllexport) virtual MxLong Notify(MxParam &p); // vtable+04 __declspec(dllexport) virtual MxResult Notify(MxParam &p); // vtable+04
virtual MxLong Tickle(); // vtable+08 virtual MxResult Tickle(); // vtable+08
// OFFSET: LEGO1 0x100144c0 // OFFSET: LEGO1 0x100144c0
inline virtual const char *ClassName() const // vtable+0c inline virtual const char *ClassName() const // vtable+0c

View file

@ -1,6 +1,7 @@
#ifndef MXTHREAD_H #ifndef MXTHREAD_H
#define MXTHREAD_H #define MXTHREAD_H
#include "compat.h"
#include "mxtypes.h" #include "mxtypes.h"
#include "mxsemaphore.h" #include "mxsemaphore.h"

View file

@ -39,8 +39,4 @@ typedef MxU8 MxBool;
#define FALSE 0 #define FALSE 0
#endif #endif
#if defined(_MSC_VER) && _MSC_VER <= 1200 // 1200 corresponds to VC6.0 but "override" was probably added even later
#define override
#endif
#endif // MXTYPE_H #endif // MXTYPE_H