fix for vs 2013 (#175)

https://github.com/bkaradzic/bgfx/issues/1261
This commit is contained in:
attilaz
2018-01-15 18:57:22 +01:00
committed by Branimir Karadžić
parent 14521c7406
commit 5c2f44354e

View File

@@ -35,9 +35,24 @@ extern "C" long _InterlockedCompareExchange(long volatile* _ptr, long _exchange,
extern "C" int64_t _InterlockedCompareExchange64(int64_t volatile* _ptr, int64_t _exchange, int64_t _comparand);
# pragma intrinsic(_InterlockedCompareExchange64)
#if (_MSC_VER == 1800) && !defined(FIXED_592562) && defined (_M_IX86) && !defined (_M_CEE_PURE)
extern "C" long _InterlockedExchange(long volatile* _ptr, long _value);
# pragma intrinsic(_InterlockedExchange)
__forceinline static void * _InterlockedExchangePointer_impl(void * volatile * _Target, void * _Value)
{
return (void *)_InterlockedExchange((long volatile *) _Target, (long) _Value);
}
#define _InterlockedExchangePointer(p,v) _InterlockedExchangePointer_impl(p,v)
#else
extern "C" void* _InterlockedExchangePointer(void* volatile* _ptr, void* _value);
# pragma intrinsic(_InterlockedExchangePointer)
#endif
# if BX_PLATFORM_WINRT
# define _InterlockedExchangeAdd64 InterlockedExchangeAdd64
# endif // BX_PLATFORM_WINRT