Fix _InterlockedCompareExchangePointer on x86

This commit is contained in:
Behdad Esfahbod 2012-07-13 09:04:07 -04:00
parent 2023e2b54d
commit 391f1ff5d8
1 changed files with 6 additions and 0 deletions

View File

@ -45,7 +45,13 @@
#elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600 #elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600
#include <intrin.h> #include <intrin.h>
/* On x86, _InterlockedCompareExchangePointer is a macro defined in concrt.h */
#if defined(_M_IX86)
#include <concrt.h>
#pragma intrinsic(_InterlockedExchangeAdd)
#else
#pragma intrinsic(_InterlockedExchangeAdd, _InterlockedCompareExchangePointer) #pragma intrinsic(_InterlockedExchangeAdd, _InterlockedCompareExchangePointer)
#endif
typedef long hb_atomic_int_t; typedef long hb_atomic_int_t;
#define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V)) #define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V))