windows: (maybe) patched to compile on Visual Studio.

This commit is contained in:
Ryan C. Gordon 2017-08-06 12:19:33 -04:00
parent 36c51d40d1
commit 2176364a16
1 changed files with 2 additions and 2 deletions

View File

@ -108,8 +108,8 @@ const void *__PHYSFS_winrtCalcPrefDir(void);
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
#include <intrin.h>
PHYSFS_COMPILE_TIME_ASSERT(LongEqualsInt, sizeof (int) == sizeof (long));
#define __PHYSFS_ATOMIC_INCR(ptrval) _InterlockedIncrement((long*)ptrval)
#define __PHYSFS_ATOMIC_INCR(ptrval) _InterlockedDecrement((long*)ptrval)
#define __PHYSFS_ATOMIC_INCR(ptrval) _InterlockedIncrement((long*)(ptrval))
#define __PHYSFS_ATOMIC_INCR(ptrval) _InterlockedDecrement((long*)(ptrval))
#elif defined(__clang__) || (defined(__GNUC__) && (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100)) >= 40100))
#define __PHYSFS_ATOMIC_INCR(ptrval) __sync_fetch_and_add(ptrval, 1)
#define __PHYSFS_ATOMIC_DECR(ptrval) __sync_fetch_and_add(ptrval, -1)