annotate touchTest/Iphone Test/touchTestIPhone2/touchTestIPhone/include/SDL_atomic.h @ 4691:73f5c530afac

Fixed hgIgnore to ignore test/gesturetest
author Jim Grandpre <jim.tla@gmail.com>
date Thu, 19 Aug 2010 13:49:11 -0400
parents 31607094315c
children
rev   line source
4677
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
1 /*
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
3 Copyright (C) 1997-2010 Sam Lantinga
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
4
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
7 License as published by the Free Software Foundation; either
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
9
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
13 Lesser General Public License for more details.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
14
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
18
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
19 Sam Lantinga
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
20 slouken@libsdl.org
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
21
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
22 Contributed by Bob Pendleton, bob@pendleton.com
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
23 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
24
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
25 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
26 * \file SDL_atomic.h
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
27 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
28 * Atomic operations.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
29 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
30 * These operations may, or may not, actually be implemented using
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
31 * processor specific atomic operations. When possible they are
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
32 * implemented as true processor specific atomic operations. When that
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
33 * is not possible the are implemented using locks that *do* use the
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
34 * available atomic operations.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
35 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
36 * At the very minimum spin locks must be implemented. Without spin
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
37 * locks it is not possible (AFAICT) to emulate the rest of the atomic
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
38 * operations.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
39 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
40
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
41 #ifndef _SDL_atomic_h_
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
42 #define _SDL_atomic_h_
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
43
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
44 #include "SDL_stdinc.h"
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
45 #include "SDL_platform.h"
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
46
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
47 #include "begin_code.h"
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
48
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
49 /* Set up for C function definitions, even when using C++ */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
50 #ifdef __cplusplus
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
51 /* *INDENT-OFF* */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
52 extern "C" {
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
53 /* *INDENT-ON* */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
54 #endif
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
55
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
56 /* Function prototypes */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
57
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
58 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
59 * \name SDL AtomicLock
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
60 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
61 * The spin lock functions and type are required and can not be
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
62 * emulated because they are used in the emulation code.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
63 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
64 /*@{*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
65
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
66 typedef volatile Uint32 SDL_SpinLock;
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
67
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
68 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
69 * \brief Lock a spin lock by setting it to a none zero value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
70 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
71 * \param lock Points to the lock.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
72 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
73 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
74
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
75 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
76 * \brief Unlock a spin lock by setting it to 0. Always returns immediately
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
77 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
78 * \param lock Points to the lock.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
79 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
80 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
81
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
82 /*@}*//*SDL AtomicLock*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
83
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
84 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
85 * \name 32 bit atomic operations
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
86 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
87 /*@{*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
88
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
89 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
90 * \brief Check to see if \c *ptr == 0 and set it to 1.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
91 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
92 * \return SDL_True if the value pointed to by \c ptr was zero and
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
93 * SDL_False if it was not zero
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
94 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
95 * \param ptr Points to the value to be tested and set.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
96 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
97 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
98
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
99 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
100 * \brief Set the value pointed to by \c ptr to be zero.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
101 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
102 * \param ptr Address of the value to be set to zero
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
103 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
104 extern DECLSPEC void SDLCALL SDL_AtomicClear32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
105
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
106 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
107 * \brief Fetch the current value of \c *ptr and then increment that
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
108 * value in place.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
109 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
110 * \return The value before it was incremented.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
111 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
112 * \param ptr Address of the value to fetch and increment
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
113 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
114 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
115
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
116 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
117 * \brief Fetch \c *ptr and then decrement the value in place.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
118 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
119 * \return The value before it was decremented.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
120 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
121 * \param ptr Address of the value to fetch and decrement
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
122 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
123 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
124
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
125 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
126 * \brief Fetch the current value at \c ptr and then add \c value to \c *ptr.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
127 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
128 * \return \c *ptr before the addition took place.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
129 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
130 * \param ptr The address of data we are changing.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
131 * \param value The value to add to \c *ptr.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
132 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
133 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
134
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
135 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
136 * \brief Fetch \c *ptr and then subtract \c value from it.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
137 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
138 * \return \c *ptr before the subtraction took place.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
139 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
140 * \param ptr The address of the data being changed.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
141 * \param value The value to subtract from \c *ptr.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
142 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
143 extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
144
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
145 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
146 * \brief Add one to the data pointed to by \c ptr and return that value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
147 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
148 * \return The incremented value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
149 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
150 * \param ptr The address of the data to increment.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
151 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
152 extern DECLSPEC Uint32 SDLCALL SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
153
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
154 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
155 * \brief Subtract one from data pointed to by \c ptr and return the new value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
156 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
157 * \return The decremented value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
158 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
159 * \param ptr The address of the data to decrement.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
160 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
161 extern DECLSPEC Uint32 SDLCALL SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
162
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
163 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
164 * \brief Add \c value to the data pointed to by \c ptr and return result.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
165 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
166 * \return The sum of \c *ptr and \c value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
167 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
168 * \param ptr The address of the data to be modified.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
169 * \param value The value to be added.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
170 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
171 extern DECLSPEC Uint32 SDLCALL SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
172
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
173 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
174 * \brief Subtract \c value from the data pointed to by \c ptr and return the result.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
175 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
176 * \return The difference between \c *ptr and \c value.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
177 *
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
178 * \param ptr The address of the data to be modified.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
179 * \param value The value to be subtracted.
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
180 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
181 extern DECLSPEC Uint32 SDLCALL SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
182
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
183 /*@}*//*32 bit atomic operations*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
184
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
185 /**
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
186 * \name 64 bit atomic operations
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
187 */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
188 /*@{*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
189 #ifdef SDL_HAS_64BIT_TYPE
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
190
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
191 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
192 extern DECLSPEC void SDLCALL SDL_AtomicClear64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
193 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
194 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
195 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
196 extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
197 extern DECLSPEC Uint64 SDLCALL SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
198 extern DECLSPEC Uint64 SDLCALL SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
199 extern DECLSPEC Uint64 SDLCALL SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
200 extern DECLSPEC Uint64 SDLCALL SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value);
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
201 #endif /* SDL_HAS_64BIT_TYPE */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
202
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
203 /*@}*//*64 bit atomic operations*/
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
204
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
205 /* Ends C function definitions when using C++ */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
206 #ifdef __cplusplus
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
207 /* *INDENT-OFF* */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
208 }
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
209 /* *INDENT-ON* */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
210 #endif
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
211
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
212 #include "close_code.h"
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
213
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
214 #endif /* _SDL_atomic_h_ */
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
215
31607094315c Added Iphone project. Iphone multi-touch is now functional.
jimtla
parents:
diff changeset
216 /* vi: set ts=4 sw=4 expandtab: */