diff --git a/common/Assertions.h b/common/Assertions.h index a7d841d07d..dadf468c45 100644 --- a/common/Assertions.h +++ b/common/Assertions.h @@ -155,8 +155,8 @@ extern pxDoAssertFnType* pxDoAssert; #define pxAssertMsg(cond, msg) (likely(cond)) #define pxAssertDev(cond, msg) (likely(cond)) -#define pxAssumeMsg(cond, msg) (__assume(cond)) -#define pxAssumeDev(cond, msg) (__assume(cond)) +#define pxAssumeMsg(cond, msg) __assume(cond) +#define pxAssumeDev(cond, msg) __assume(cond) #define pxFail(msg) \ do \ diff --git a/common/Pcsx2Defs.h b/common/Pcsx2Defs.h index 2e4a8a80c0..c667ea51df 100644 --- a/common/Pcsx2Defs.h +++ b/common/Pcsx2Defs.h @@ -146,7 +146,7 @@ static const int __pagesize = PCSX2_PAGESIZE; #define __aligned32 __attribute__((aligned(32))) #define __pagealigned __attribute__((aligned(PCSX2_PAGESIZE))) - #define __assume(cond) ((void)0) // GCC has no equivalent for __assume + #define __assume(cond) do { if (!(cond)) __builtin_unreachable(); } while(0) #define CALLBACK __attribute__((stdcall)) // Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress @@ -154,7 +154,11 @@ static const int __pagesize = PCSX2_PAGESIZE; // happens *by design* like all the friggen time >_<) #ifndef __fastcall - #define __fastcall __attribute__((fastcall)) + #ifndef _M_X86_32 + #define __fastcall // Attribute not available, and x86_32 is pretty much the only cc that passes literally everything in registers + #else + #define __fastcall __attribute__((fastcall)) + #endif #endif #define __vectorcall __fastcall #define _inline __inline__ __attribute__((unused))