added __PHYSFS_ATOMIC_INCR and __PHYSFS_ATOMIC_DECR for watcom compiler
This commit is contained in:
parent
268d9e6266
commit
40ff5dba86
|
@ -117,6 +117,15 @@ __PHYSFS_COMPILE_TIME_ASSERT(LongEqualsInt, sizeof (int) == sizeof (long));
|
|||
#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)
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
extern __inline int _xadd_watcom(volatile int *a, int v);
|
||||
#pragma aux _xadd_watcom = \
|
||||
"lock xadd [ecx], eax" \
|
||||
parm [ecx] [eax] \
|
||||
value [eax] \
|
||||
modify exact [eax];
|
||||
#define __PHYSFS_ATOMIC_INCR(ptrval) _xadd_watcom(ptrval, 1)
|
||||
#define __PHYSFS_ATOMIC_DECR(ptrval) _xadd_watcom(ptrval, -1)
|
||||
#else
|
||||
#define PHYSFS_NEED_ATOMIC_OP_FALLBACK 1
|
||||
int __PHYSFS_ATOMIC_INCR(int *ptrval);
|
||||
|
|
Loading…
Reference in New Issue