annotate test/testatomic.c @ 3237:916f396fe65d

Start of redesign, getting rid of 8 and 16 bit operations in .h and test files.
author Bob Pendleton <bob@pendleton.com>
date Tue, 11 Aug 2009 21:27:19 +0000
parents 48a80f2a7ff2
children 72b542f34739
rev   line source
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
1 #include "SDL.h"
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
2
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
3 /*
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
4 Absolutely basic tests just to see if we get the expected value
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
5 after calling each function.
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
6 */
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
7
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
8 char *
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
9 tf(SDL_bool tf)
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
10 {
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
11 static char *t = "true";
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
12 static char *f = "false";
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
13
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
14 if (tf)
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
15 {
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
16 return t;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
17 }
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
18
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
19 return f;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
20 }
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
21
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
22 int
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
23 main(int argc, char **argv)
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
24 {
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
25
3216
48a80f2a7ff2 volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents: 3202
diff changeset
26 volatile Uint32 val32 = 0;
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
27 Uint32 ret32 = 0;
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
28
3216
48a80f2a7ff2 volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents: 3202
diff changeset
29 volatile Uint64 val64 = 0;
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
30 Uint64 ret64 = 0;
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
31
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
32 SDL_bool tfret = SDL_FALSE;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
33
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
34 printf("32 bit -----------------------------------------\n\n");
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
35
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
36 ret32 = SDL_AtomicExchange32(&val32, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
37 printf("Exchange32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
38 ret32 = SDL_AtomicExchange32(&val32, 0);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
39 printf("Exchange32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
40
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
41 val32 = 10;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
42 tfret = SDL_AtomicCompareThenSet32(&val32, 10, 20);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
43 printf("CompareThenSet32 tfret=%s val=%d\n", tf(tfret), val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
44 val32 = 10;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
45 tfret = SDL_AtomicCompareThenSet32(&val32, 0, 20);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
46 printf("CompareThenSet32 tfret=%s val=%d\n", tf(tfret), val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
47
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
48 val32 = 0;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
49 tfret = SDL_AtomicTestThenSet32(&val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
50 printf("TestThenSet32 tfret=%s val=%d\n", tf(tfret), val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
51 tfret = SDL_AtomicTestThenSet32(&val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
52 printf("TestThenSet32 tfret=%s val=%d\n", tf(tfret), val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
53
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
54 SDL_AtomicClear32(&val32);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
55 printf("Clear32 val=%d\n", val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
56
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
57 ret32 = SDL_AtomicFetchThenIncrement32(&val32);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
58 printf("FetchThenIncrement32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
59
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
60 ret32 = SDL_AtomicFetchThenDecrement32(&val32);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
61 printf("FetchThenDecrement32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
62
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
63 ret32 = SDL_AtomicFetchThenAdd32(&val32, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
64 printf("FetchThenAdd32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
65
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
66 ret32 = SDL_AtomicFetchThenSubtract32(&val32, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
67 printf("FetchThenSubtract32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
68
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
69 ret32 = SDL_AtomicIncrementThenFetch32(&val32);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
70 printf("IncrementThenFetch32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
71
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
72 ret32 = SDL_AtomicDecrementThenFetch32(&val32);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
73 printf("DecrementThenFetch32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
74
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
75 ret32 = SDL_AtomicAddThenFetch32(&val32, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
76 printf("AddThenFetch32 ret=%d val=%d\n", ret32, val32);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
77
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
78 ret32 = SDL_AtomicSubtractThenFetch32(&val32, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
79 printf("SubtractThenFetch32 ret=%d val=%d\n", ret32, val32);
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
80
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
81 #ifdef SDL_HAS_64BIT_TYPE
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
82 printf("64 bit -----------------------------------------\n\n");
3180
77d6336711fc First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff changeset
83
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
84 ret64 = SDL_AtomicExchange64(&val64, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
85 printf("Exchange64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
86 ret64 = SDL_AtomicExchange64(&val64, 0);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
87 printf("Exchange64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
88
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
89 val64 = 10;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
90 tfret = SDL_AtomicCompareThenSet64(&val64, 10, 20);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
91 printf("CompareThenSet64 tfret=%s val=%lld\n", tf(tfret), val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
92 val64 = 10;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
93 tfret = SDL_AtomicCompareThenSet64(&val64, 0, 20);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
94 printf("CompareThenSet64 tfret=%s val=%lld\n", tf(tfret), val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
95
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
96 val64 = 0;
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
97 tfret = SDL_AtomicTestThenSet64(&val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
98 printf("TestThenSet64 tfret=%s val=%lld\n", tf(tfret), val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
99 tfret = SDL_AtomicTestThenSet64(&val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
100 printf("TestThenSet64 tfret=%s val=%lld\n", tf(tfret), val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
101
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
102 SDL_AtomicClear64(&val64);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
103 printf("Clear64 val=%lld\n", val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
104
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
105 ret64 = SDL_AtomicFetchThenIncrement64(&val64);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
106 printf("FetchThenIncrement64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
107
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
108 ret64 = SDL_AtomicFetchThenDecrement64(&val64);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
109 printf("FetchThenDecrement64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
110
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
111 ret64 = SDL_AtomicFetchThenAdd64(&val64, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
112 printf("FetchThenAdd64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
113
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
114 ret64 = SDL_AtomicFetchThenSubtract64(&val64, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
115 printf("FetchThenSubtract64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
116
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
117 ret64 = SDL_AtomicIncrementThenFetch64(&val64);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
118 printf("IncrementThenFetch64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
119
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
120 ret64 = SDL_AtomicDecrementThenFetch64(&val64);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
121 printf("DecrementThenFetch64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
122
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
123 ret64 = SDL_AtomicAddThenFetch64(&val64, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
124 printf("AddThenFetch64 ret=%lld val=%lld\n", ret64, val64);
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
125
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
126 ret64 = SDL_AtomicSubtractThenFetch64(&val64, 10);
3202
3aa519a5c676 I've made so many changes I don't dare continue until I check the current stuff in.
Bob Pendleton <bob@pendleton.com>
parents: 3201
diff changeset
127 printf("SubtractThenFetch64 ret=%lld val=%lld\n", ret64, val64);
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
128 #endif
3186
Sam Lantinga <slouken@libsdl.org>
parents: 3180
diff changeset
129
3201
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
130 return 0;
c297230efc75 Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents: 3199
diff changeset
131 }