diff --git a/src/addresses.c b/src/addresses.c index 335d905b72..c5a1ff6d9a 100644 --- a/src/addresses.c +++ b/src/addresses.c @@ -12,7 +12,8 @@ int DISABLE_OPT RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _edx, int _esi, int _edi, int _ebp) { - int result; + int result = 0; +#ifdef PLATFORM_X86 #ifdef _MSC_VER __asm { push ebp @@ -56,13 +57,15 @@ int DISABLE_OPT RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _ : "eax","ecx","edx","esi","edi","memory" ); #endif +#endif // PLATFORM_X86 // lahf only modifies ah, zero out the rest return result & 0xFF00; } int DISABLE_OPT RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, int *_edx, int *_esi, int *_edi, int *_ebp) { - int result; + int result = 0; +#ifdef PLATFORM_X86 #ifdef _MSC_VER __asm { // Store C's base pointer @@ -207,6 +210,7 @@ int DISABLE_OPT RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, in : "eax","ecx","edx","esi","edi","memory" ); #endif +#endif // PLATFORM_X86 // lahf only modifies ah, zero out the rest return result & 0xFF00; } diff --git a/src/common.h b/src/common.h index e58c85ae93..a27ea5daf9 100644 --- a/src/common.h +++ b/src/common.h @@ -34,6 +34,11 @@ #endif #define abstract = 0 +#if defined(__i386__) || defined(_M_I86) +#define PLATFORM_X86 +#endif + +#ifdef PLATFORM_X86 #ifdef __GNUC__ #define FASTCALL __attribute__((fastcall)) #elif _MSC_VER @@ -42,5 +47,8 @@ #pragma message "Not using fastcall calling convention, please check your compiler support" #define FASTCALL #endif +#else // PLATFORM_X86 +#define FASTCALL +#endif // PLATFORM_X86 #endif