]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix compilation of dpsoftrast on mingw32 (use Interlocked* instead of __sync_*)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Apr 2011 19:23:57 +0000 (19:23 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 10 Apr 2011 19:23:37 +0000 (21:23 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11048 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=068b4bae6bdc5b323d9a75de52f9f51afc5a3003

dpsoftrast.c

index 222b71c6666e7e928fee8643588629d74990e7e7..75d6db8016696f8b6ea38ef1e69ec2411089dd32 100644 (file)
@@ -27,6 +27,15 @@ typedef qboolean bool;
                #define ATOMIC_INCREMENT(counter) (OSAtomicIncrement32Barrier(&(counter)))
                #define ATOMIC_DECREMENT(counter) (OSAtomicDecrement32Barrier(&(counter)))
                #define ATOMIC_ADD(counter, val) ((void)OSAtomicAdd32Barrier((val), &(counter)))
+       #elif defined(__GNUC__) && defined(WIN32)
+               #define ALIGN(var) var __attribute__((__aligned__(16)))
+               #define ATOMIC(var) var __attribute__((__aligned__(32)))
+               #define MEMORY_BARRIER (_mm_sfence())
+               //(__sync_synchronize())
+               #define ATOMIC_COUNTER volatile LONG
+               #define ATOMIC_INCREMENT(counter) (InterlockedIncrement(&(counter)))
+               #define ATOMIC_DECREMENT(counter) (InterlockedDecrement(&(counter)))
+               #define ATOMIC_ADD(counter, val) ((void)InterlockedExchangeAdd(&(counter), (val)))
        #elif defined(__GNUC__)
                #define ALIGN(var) var __attribute__((__aligned__(16)))
                #define ATOMIC(var) var __attribute__((__aligned__(32)))