mirror of
https://github.com/yawut/SDL.git
synced 2026-08-22 08:45:31 -05:00
This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
It also update configure.in to compile the linux version of the library. The three versions are all dummies implementations that do nothing. They are being checked in as place holders. Mostly, I just wanted to get place holders and the configure.in checked in.
This commit is contained in:
@@ -3,62 +3,62 @@
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int rv = 10;
|
||||
volatile int atomic;
|
||||
/* int rv = 10; */
|
||||
/* volatile int atomic; */
|
||||
|
||||
SDL_atomic_int_set(&atomic, 10);
|
||||
if (SDL_atomic_int_get(&atomic) != 10)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_set(atomic, 10): atomic-> %d\n",
|
||||
SDL_atomic_int_get(&atomic));
|
||||
/* SDL_atomic_int_set(&atomic, 10); */
|
||||
/* if (SDL_atomic_int_get(&atomic) != 10) */
|
||||
/* printf("Error: "); */
|
||||
/* printf("SDL_atomic_int_set(atomic, 10): atomic-> %d\n", */
|
||||
/* SDL_atomic_int_get(&atomic)); */
|
||||
|
||||
SDL_atomic_int_add(&atomic, 10);
|
||||
if (SDL_atomic_int_get(&atomic) != 20)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_add(atomic, 10): atomic-> %d\n",
|
||||
SDL_atomic_int_get(&atomic));
|
||||
/* SDL_atomic_int_add(&atomic, 10); */
|
||||
/* if (SDL_atomic_int_get(&atomic) != 20) */
|
||||
/* 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);
|
||||
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); */
|
||||
/* 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);
|
||||
if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 30)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_cmp_xchg(atomic, 20, 40): rv-> %d, atomic-> %d\n",
|
||||
rv, SDL_atomic_int_get(&atomic));
|
||||
/* rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30); */
|
||||
/* if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 30) */
|
||||
/* printf("Error: "); */
|
||||
/* printf("SDL_atomic_int_cmp_xchg(atomic, 20, 40): rv-> %d, atomic-> %d\n", */
|
||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
||||
|
||||
rv = SDL_atomic_int_xchg_add(&atomic, 10);
|
||||
if (rv != 30 || SDL_atomic_int_get(&atomic) != 40)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_xchg_add(atomic, 10): rv-> %d, atomic-> %d\n",
|
||||
rv, SDL_atomic_int_get(&atomic));
|
||||
/* rv = SDL_atomic_int_xchg_add(&atomic, 10); */
|
||||
/* if (rv != 30 || SDL_atomic_int_get(&atomic) != 40) */
|
||||
/* 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);
|
||||
if (SDL_atomic_int_get(&atomic) != 41)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_inc(atomic): atomic-> %d\n",
|
||||
SDL_atomic_int_get(&atomic));
|
||||
/* SDL_atomic_int_inc(&atomic); */
|
||||
/* if (SDL_atomic_int_get(&atomic) != 41) */
|
||||
/* printf("Error: "); */
|
||||
/* printf("SDL_atomic_int_inc(atomic): atomic-> %d\n", */
|
||||
/* SDL_atomic_int_get(&atomic)); */
|
||||
|
||||
rv = SDL_atomic_int_dec_test(&atomic);
|
||||
if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 40)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n",
|
||||
rv, SDL_atomic_int_get(&atomic));
|
||||
/* rv = SDL_atomic_int_dec_test(&atomic); */
|
||||
/* if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 40) */
|
||||
/* printf("Error: "); */
|
||||
/* printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n", */
|
||||
/* rv, SDL_atomic_int_get(&atomic)); */
|
||||
|
||||
SDL_atomic_int_set(&atomic, 1);
|
||||
if (SDL_atomic_int_get(&atomic) != 1)
|
||||
printf("Error: ");
|
||||
printf("SDL_atomic_int_set(atomic, 1): atomic-> %d\n",
|
||||
SDL_atomic_int_get(&atomic));
|
||||
/* SDL_atomic_int_set(&atomic, 1); */
|
||||
/* 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));
|
||||
/* 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user