From fd0f3a5746b5e789055f28f55822f632ff0a1604 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 6 Aug 2011 13:56:48 -0700 Subject: [PATCH] Mingw fixes for ProfileManager. --- Sources/Plasma/NucleusLib/inc/plProfileManager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp b/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp index deb8a90b..94c84704 100644 --- a/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp +++ b/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp @@ -40,10 +40,16 @@ static UInt32 gCyclesPerMS = 0; #pragma warning (push) #pragma warning (disable : 4035) // disable no return value warning -__forceinline UInt32 GetPentiumCounter() +#ifdef _MSC_VER +#define forceinline __forceinline +#else +#define forceinline inline +#endif + +forceinline UInt32 GetPentiumCounter() { - __asm - { +#ifdef _MSC_VER + __asm { xor eax,eax // VC won't realize that eax is modified w/out this // instruction to modify the val. // Problem shows up in release mode builds @@ -52,6 +58,7 @@ __forceinline UInt32 GetPentiumCounter() xor edx,edx // so VC gets that edx is modified } +#endif } #pragma warning (pop)