Disabling 64 bit atomics operations until I figure out why they do not link.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403669
This commit is contained in:
parent
bd15ea1fd5
commit
9b4d5550f8
2 changed files with 41 additions and 56 deletions
|
@ -20,8 +20,6 @@
|
||||||
slouken@libsdl.org
|
slouken@libsdl.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef SDL_ATOMIC_LINUX
|
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
#include "SDL_atomic.h"
|
#include "SDL_atomic.h"
|
||||||
|
@ -98,7 +96,8 @@ SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value)
|
||||||
return __sync_sub_and_fetch(ptr, value);
|
return __sync_sub_and_fetch(ptr, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDL_HAS_64BIT_TYPE
|
/* #ifdef SDL_HAS_64BIT_TYPE */
|
||||||
|
#if 0
|
||||||
|
|
||||||
Uint64
|
Uint64
|
||||||
SDL_AtomicExchange64(Uint64 * ptr, Uint64 value)
|
SDL_AtomicExchange64(Uint64 * ptr, Uint64 value)
|
||||||
|
@ -172,4 +171,3 @@ SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value)
|
||||||
return __sync_sub_and_fetch(ptr, value);
|
return __sync_sub_and_fetch(ptr, value);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,64 +1,51 @@
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Absolutely basic test just to see if we get the expected value after
|
||||||
|
calling each function.
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
/* int rv = 10; */
|
|
||||||
/* volatile int atomic; */
|
|
||||||
|
|
||||||
/* SDL_atomic_int_set(&atomic, 10); */
|
Uint32 val32 = 0;
|
||||||
/* if (SDL_atomic_int_get(&atomic) != 10) */
|
Uint32 ret32 = 0;
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_set(atomic, 10): atomic-> %d\n", */
|
|
||||||
/* SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
/* SDL_atomic_int_add(&atomic, 10); */
|
Uint64 val64 = 0;
|
||||||
/* if (SDL_atomic_int_get(&atomic) != 20) */
|
Uint64 ret64 = 0;
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_add(atomic, 10): atomic-> %d\n", */
|
|
||||||
/* SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
/* rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30); */
|
SDL_bool tfval = SDL_FALSE;
|
||||||
/* if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 30) */
|
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_cmp_xchg(atomic, 20, 30): rv-> %d, atomic-> %d\n", */
|
|
||||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
/* rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30); */
|
ret32 = SDL_AtomicExchange32(&val32, 10);
|
||||||
/* if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 30) */
|
tfval = SDL_AtomicCompareThenSet32(&val32, 10, 20);
|
||||||
/* printf("Error: "); */
|
tfval = SDL_AtomicTestThenSet32(&val32);
|
||||||
/* printf("SDL_atomic_int_cmp_xchg(atomic, 20, 40): rv-> %d, atomic-> %d\n", */
|
SDL_AtomicClear32(&val32);
|
||||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
ret32 = SDL_AtomicFetchThenIncrement32(&val32);
|
||||||
|
ret32 = SDL_AtomicFetchThenDecrement32(&val32);
|
||||||
|
ret32 = SDL_AtomicFetchThenAdd32(&val32, 10);
|
||||||
|
ret32 = SDL_AtomicFetchThenSubtract32(&val32, 10);
|
||||||
|
ret32 = SDL_AtomicIncrementThenFetch32(&val32);
|
||||||
|
ret32 = SDL_AtomicDecrementThenFetch32(&val32);
|
||||||
|
ret32 = SDL_AtomicAddThenFetch32(&val32, 10);
|
||||||
|
ret32 = SDL_AtomicSubtractThenFetch32(&val32, 10);
|
||||||
|
|
||||||
/* rv = SDL_atomic_int_xchg_add(&atomic, 10); */
|
/* #ifdef SDL_HAS_64BIT_TYPE */
|
||||||
/* if (rv != 30 || SDL_atomic_int_get(&atomic) != 40) */
|
#if 0
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_xchg_add(atomic, 10): rv-> %d, atomic-> %d\n", */
|
|
||||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
/* SDL_atomic_int_inc(&atomic); */
|
ret64 = SDL_AtomicExchange64(&val64, 10);
|
||||||
/* if (SDL_atomic_int_get(&atomic) != 41) */
|
tfval = SDL_AtomicCompareThenSet64(&val64, 10, 20);
|
||||||
/* printf("Error: "); */
|
tfval = SDL_AtomicTestThenSet64(&val64);
|
||||||
/* printf("SDL_atomic_int_inc(atomic): atomic-> %d\n", */
|
SDL_AtomicClear64(&val64);
|
||||||
/* SDL_atomic_int_get(&atomic)); */
|
ret64 = SDL_AtomicFetchThenIncrement64(&val64);
|
||||||
|
ret64 = SDL_AtomicFetchThenDecrement64(&val64);
|
||||||
/* rv = SDL_atomic_int_dec_test(&atomic); */
|
ret64 = SDL_AtomicFetchThenAdd64(&val64, 10);
|
||||||
/* if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 40) */
|
ret64 = SDL_AtomicFetchThenSubtract64(&val64, 10);
|
||||||
/* printf("Error: "); */
|
ret64 = SDL_AtomicIncrementThenFetch64(&val64);
|
||||||
/* printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n", */
|
ret64 = SDL_AtomicDecrementThenFetch64(&val64);
|
||||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
ret64 = SDL_AtomicAddThenFetch64(&val64, 10);
|
||||||
|
ret64 = SDL_AtomicSubtractThenFetch64(&val64, 10);
|
||||||
/* SDL_atomic_int_set(&atomic, 1); */
|
#endif
|
||||||
/* if (SDL_atomic_int_get(&atomic) != 1) */
|
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_set(atomic, 1): atomic-> %d\n", */
|
|
||||||
/* SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
/* rv = SDL_atomic_int_dec_test(&atomic); */
|
|
||||||
/* if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 0) */
|
|
||||||
/* printf("Error: "); */
|
|
||||||
/* printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n", */
|
|
||||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue