Mercurial > sdl-ios-xcode
annotate test/testatomic.c @ 3402:1653b8eac4d3
Fixed bug #852
Jesse Anders 2009-10-17 14:17:25 PDT
In VC++, the build script that creates SDL_config.h and SDL_revision.h fails
when the project directory path includes spaces. For example, if the project
directory path is:
c:\Documents and Settings\Jesse\My Documents\Visual Studio 2008\Projects\SDL
1.3\VisualC\SDL\
The following error is generated:
'and' is not recognized as an internal or external command
Placing all paths in quotes fixes this.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 17 Oct 2009 21:46:08 +0000 |
parents | 9de326b3099c |
children | 3a95a2b93eb3 |
rev | line source |
---|---|
3338 | 1 #include <stdio.h> |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
2 #include "SDL.h" |
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
3 |
3327
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
4 /* 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
|
5 #ifndef PRIu32 |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
6 #define PRIu32 "u" |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
7 #endif |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
8 #ifndef PRIu64 |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
9 #ifdef __WIN32__ |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
10 #define PRIu64 "I64u" |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
11 #else |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
12 #define PRIu64 "llu" |
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 #endif |
35387815b155
Better cross-platform macros for printing 32 and 64 bit values
Sam Lantinga <slouken@libsdl.org>
parents:
3325
diff
changeset
|
15 |
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
|
16 /* |
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
|
17 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
|
18 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
|
19 */ |
c297230efc75
Disabling 64 bit atomics operations until I figure out why they do not link.
Bob Pendleton <bob@pendleton.com>
parents:
3199
diff
changeset
|
20 |
3338 | 21 char * |
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
|
22 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
|
23 { |
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 *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
|
25 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
|
26 |
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 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
|
28 { |
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 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
|
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 |
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 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
|
33 } |
3338 | 34 |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
35 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
|
36 main(int argc, char *argv[]) |
3180
77d6336711fc
First commit for SDL atomic operations.
Bob Pendleton <bob@pendleton.com>
parents:
diff
changeset
|
37 { |
3186 | 38 |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
39 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
|
40 Uint32 ret32 = 0; |
3186 | 41 |
3216
48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
Bob Pendleton <bob@pendleton.com>
parents:
3202
diff
changeset
|
42 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
|
43 Uint64 ret64 = 0; |
3186 | 44 |
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
|
45 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
|
46 |
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
|
47 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
|
48 |
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
|
49 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
|
50 |
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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 |
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
|
56 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
|
57 |
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 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
|
59 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
|
60 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
|
61 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
|
62 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
|
63 |
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
|
64 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
|
65 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
|
66 |
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
|
67 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
|
68 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
|
69 |
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
|
70 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
|
71 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
|
72 |
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
|
73 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
|
74 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
|
75 |
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
|
76 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
|
77 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
|
78 |
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
|
79 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
|
80 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
|
81 |
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
|
82 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
|
83 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
|
84 |
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
|
85 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
|
86 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
|
87 |
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
|
88 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
|
89 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
|
90 |
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
|
91 #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
|
92 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
|
93 |
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 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
|
95 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
|
96 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
|
97 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
|
98 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
|
99 |
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
|
100 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
|
101 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
|
102 |
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
|
103 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
|
104 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
|
105 |
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
|
106 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
|
107 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
|
108 |
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
|
109 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
|
110 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
|
111 |
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
|
112 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
|
113 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
|
114 |
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
|
115 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
|
116 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
|
117 |
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
|
118 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
|
119 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
|
120 |
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
|
121 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
|
122 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
|
123 |
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
|
124 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
|
125 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
|
126 #endif |
3186 | 127 |
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 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
|
129 } |