From 95e9fe41d2d77b6ef2cc80552c6d333c53683e2a Mon Sep 17 00:00:00 2001 From: kobalicek Date: Fri, 6 Jun 2014 12:32:45 +0200 Subject: [PATCH] Reworked _InterlockedCompareExchange a bit more... --- src/asmjit/base/cputicks.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/asmjit/base/cputicks.cpp b/src/asmjit/base/cputicks.cpp index 8f9a624..cb10ff1 100644 --- a/src/asmjit/base/cputicks.cpp +++ b/src/asmjit/base/cputicks.cpp @@ -21,6 +21,17 @@ # include #endif // ASMJIT_OS_MAC +// [Dependencies - Windows] +#if defined(ASMJIT_OS_WINDOWS) +// `_InterlockedCompareExchange` is only available as intrinsic (MS Compiler). +# if defined(_MSC_VER) +# include +# pragma intrinsic(_InterlockedCompareExchange) +# else +# define _InterlockedCompareExchange InterlockedCompareExchange +# endif // _MSC_VER +#endif // ASMJIT_OS_WINDOWS + // [Api-Begin] #include "../apibegin.h" @@ -31,14 +42,6 @@ namespace asmjit { // ============================================================================ #if defined(ASMJIT_OS_WINDOWS) - -// `_InterlockedCompareExchange` is only available as intrinsic (MS Compiler). -#if defined(_MSC_VER) -# pragma intrinsic(_InterlockedCompareExchange) -#else -# define _InterlockedCompareExchange InterlockedCompareExchange -#endif // _MSC_VER - static volatile uint32_t CpuTicks_hiResOk; static volatile double CpuTicks_hiResFreq;