From 4cdce55615f5863d1df2fef9169fa2b8ff25cb47 Mon Sep 17 00:00:00 2001 From: comex Date: Tue, 24 Sep 2013 01:30:41 -0400 Subject: Don't define _M_IX86 on ARM(!). Also define _M_* in a common location, and clean up code that these changes break (including DSPJit files that assume X86 yet are compiled on ARM for some reason...) --- Source/Core/Common/Src/Common.h | 17 ++++++++++++++--- Source/Core/Common/Src/CommonFuncs.h | 1 + Source/Core/Common/Src/x64CPUDetect.cpp | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common') diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index 7db22c2c87..6556f1fd17 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -49,7 +49,6 @@ private: #include "Log.h" #include "CommonTypes.h" #include "MsgHandler.h" -#include "CommonFuncs.h" #ifdef __APPLE__ // The Darwin ABI requires that stack frames be aligned to 16-byte boundaries. @@ -100,14 +99,24 @@ private: #endif // Windows compatibility +#define _M_64BIT defined(_LP64) || defined(_WIN64) #ifndef _WIN32 #include #define MAX_PATH PATH_MAX -#ifdef _LP64 +#ifdef __x86_64__ #define _M_X64 1 -#else +#endif +#ifdef __i386__ #define _M_IX86 1 #endif +#ifdef __arm__ +#define _M_ARM 1 +#define _M_GENERIC 1 +#endif +#ifdef __mips__ +#define _M_MIPS 1 +#define _M_GENERIC 1 +#endif #define __forceinline inline __attribute__((always_inline)) #define GC_ALIGNED16(x) __attribute__((aligned(16))) x #define GC_ALIGNED32(x) __attribute__((aligned(32))) x @@ -164,4 +173,6 @@ enum EMUSTATE_CHANGE EMUSTATE_CHANGE_STOP }; +#include "CommonFuncs.h" + #endif // _COMMON_H_ diff --git a/Source/Core/Common/Src/CommonFuncs.h b/Source/Core/Common/Src/CommonFuncs.h index 7f62684efb..daf135373e 100644 --- a/Source/Core/Common/Src/CommonFuncs.h +++ b/Source/Core/Common/Src/CommonFuncs.h @@ -14,6 +14,7 @@ #include #include +#include "Common.h" // Will fail to compile on a non-array: // TODO: make this a function when constexpr is available diff --git a/Source/Core/Common/Src/x64CPUDetect.cpp b/Source/Core/Common/Src/x64CPUDetect.cpp index e4eac54ef1..3db6227ca7 100644 --- a/Source/Core/Common/Src/x64CPUDetect.cpp +++ b/Source/Core/Common/Src/x64CPUDetect.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include "Common.h" #ifdef _WIN32 #define _interlockedbittestandset workaround_ms_header_bug_platform_sdk6_set -- cgit v1.2.3