Mercurial > sdl-ios-xcode
annotate test/testatomic.c @ 3334:61ea9005fddf
Use gcc's built-in dependency generation, thanks to Adam Strzelecki
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 04 Oct 2009 03:38:01 +0000 |
parents | 35387815b155 |
children | 9de326b3099c |
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 |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
3 /* Make sure we have good macros for printing 32 and 64 bit values */ |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
4 #ifndef PRIu32 |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
5 #define PRIu32 "u" |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
6 #endif |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
7 #ifndef PRIu64 |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
8 #ifdef __WIN32__ |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
9 #define PRIu64 "I64u" |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
10 #else |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
11 #define PRIu64 "llu" |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
12 #endif |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
13 #endif |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
14 |
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
|
15 /* |
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
|
16 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
|
17 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
|
18 */ |
c297230efc75
Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
19 |
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
|
20 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
|
21 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
|
22 { |
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
|
23 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
|
24 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
|
25 |
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
|
26 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
|
27 { |
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
|
28 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
|
29 } |
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
|
30 |
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
|
31 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
|
32 } |
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 |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
34 int |
3299
975fd903466b
int testmmousetable.c the arguments to main() are not compatible with what is required in SDL_main.h
Bob Pendleton <bob@pendleton.com>
parents:
3261
diff
changeset
|
35 main(int argc, char *argv[]) |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
36 { |
3186 | 37 |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
38 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
|
39 Uint32 ret32 = 0; |
3186 | 40 |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
41 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
|
42 Uint64 ret64 = 0; |
3186 | 43 |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
44 SDL_SpinLock lock = 0; |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
45 |
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
|
46 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
|
47 |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
48 printf("\nspin lock---------------------------------------\n\n"); |
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
|
49 |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
50 SDL_AtomicLock(&lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
51 printf("AtomicLock lock=%d\n", lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
52 SDL_AtomicUnlock(&lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
53 printf("AtomicUnlock lock=%d\n", lock); |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
54 |
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
55 printf("\n32 bit -----------------------------------------\n\n"); |
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
|
56 |
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
|
57 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
|
58 tfret = SDL_AtomicTestThenSet32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
59 printf("TestThenSet32 tfret=%s val=%"PRIu32"\n", tf(tfret), 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
|
60 tfret = SDL_AtomicTestThenSet32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
61 printf("TestThenSet32 tfret=%s val=%"PRIu32"\n", tf(tfret), 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
|
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 SDL_AtomicClear32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
64 printf("Clear32 val=%"PRIu32"\n", 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
|
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_AtomicFetchThenIncrement32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
67 printf("FetchThenIncrement32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
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_AtomicFetchThenDecrement32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
70 printf("FetchThenDecrement32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
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_AtomicFetchThenAdd32(&val32, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
73 printf("FetchThenAdd32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
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_AtomicFetchThenSubtract32(&val32, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
76 printf("FetchThenSubtract32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
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_AtomicIncrementThenFetch32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
79 printf("IncrementThenFetch32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
80 |
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
|
81 ret32 = SDL_AtomicDecrementThenFetch32(&val32); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
82 printf("DecrementThenFetch32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
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 ret32 = SDL_AtomicAddThenFetch32(&val32, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
85 printf("AddThenFetch32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, 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
|
86 |
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
|
87 ret32 = SDL_AtomicSubtractThenFetch32(&val32, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
88 printf("SubtractThenFetch32 ret=%"PRIu32" val=%"PRIu32"\n", ret32, val32); |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
89 |
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
|
90 #ifdef SDL_HAS_64BIT_TYPE |
3261
72b542f34739
The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
Bob Pendleton <bob@pendleton.com>
parents:
3237
diff
changeset
|
91 printf("\n64 bit -----------------------------------------\n\n"); |
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
|
92 |
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 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
|
94 tfret = SDL_AtomicTestThenSet64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
95 printf("TestThenSet64 tfret=%s val=%"PRIu64"\n", tf(tfret), 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
|
96 tfret = SDL_AtomicTestThenSet64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
97 printf("TestThenSet64 tfret=%s val=%"PRIu64"\n", tf(tfret), 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
|
98 |
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
|
99 SDL_AtomicClear64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
100 printf("Clear64 val=%"PRIu64"\n", 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
|
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 ret64 = SDL_AtomicFetchThenIncrement64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
103 printf("FetchThenIncrement64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicFetchThenDecrement64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
106 printf("FetchThenDecrement64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicFetchThenAdd64(&val64, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
109 printf("FetchThenAdd64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicFetchThenSubtract64(&val64, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
112 printf("FetchThenSubtract64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicIncrementThenFetch64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
115 printf("IncrementThenFetch64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicDecrementThenFetch64(&val64); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
118 printf("DecrementThenFetch64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicAddThenFetch64(&val64, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
121 printf("AddThenFetch64 ret=%"PRIu64" val=%"PRIu64"\n", ret64, 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
|
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_AtomicSubtractThenFetch64(&val64, 10); |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
124 printf("SubtractThenFetch64 ret=%"PRIu64" val=%"PRIu64"\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
|
125 #endif |
3186 | 126 |
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
|
127 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
|
128 } |