From 9b81779ae3a10134bcca6c299aa74d8e88fbd792 Mon Sep 17 00:00:00 2001 From: BeaR Date: Wed, 3 Apr 2013 11:44:06 +0200 Subject: [PATCH] Using MemoryBarrier() for CPUs not supporting SSE2 --- src/base/tl/threading.h | 5 ++++- src/engine/client/client.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/base/tl/threading.h b/src/base/tl/threading.h index c2bc5abcc..2cfbc0523 100644 --- a/src/base/tl/threading.h +++ b/src/base/tl/threading.h @@ -35,6 +35,9 @@ #elif defined(_MSC_VER) #include + #define WIN32_LEAN_AND_MEAN + #include + inline unsigned atomic_inc(volatile unsigned *pValue) { return _InterlockedIncrement((volatile long *)pValue); @@ -52,7 +55,7 @@ inline void sync_barrier() { - _mm_mfence(); + MemoryBarrier(); } #else #error missing atomic implementation for this compiler diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 30f92eb0b..3300d6ca5 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include