mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Define MxLong/MxULong (#71)
* define MxLong/MxULong The "long" type has different sizes on different platforms, and this may cause issues. * use DWORD to match RegQueryValueExA arg
This commit is contained in:
@@ -8,11 +8,24 @@ typedef short MxS16;
|
||||
typedef unsigned int MxU32;
|
||||
typedef int MxS32;
|
||||
|
||||
typedef unsigned long MxResult;
|
||||
const MxResult SUCCESS = 0;
|
||||
const MxResult FAILURE = 0xFFFFFFFFL;
|
||||
// On MSVC, a long is 32-bit, but on GCC/Clang, it's 64-bit. LEGO Island obviously
|
||||
// assumes the former in all cases, which could become an issue in the future.
|
||||
// The "longs" can't all be changed to "ints" (which are 32-bit on both) because
|
||||
// this will break DLL export compatibility. Therefore, we define MxLong/MxULong,
|
||||
// which is guaranteed to be 32-bit, and guaranteed to be a "long" on MSVC.
|
||||
#if defined(_MSC_VER)
|
||||
typedef long MxLong;
|
||||
typedef unsigned long MxULong;
|
||||
#else
|
||||
typedef int MxLong;
|
||||
typedef unsigned int MxULong;
|
||||
#endif
|
||||
|
||||
typedef unsigned char MxBool;
|
||||
typedef MxLong MxResult;
|
||||
const MxResult SUCCESS = 0;
|
||||
const MxResult FAILURE = -1;
|
||||
|
||||
typedef MxU8 MxBool;
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
|
Reference in New Issue
Block a user