comparison src/thread/SDL_thread.c @ 1659:14717b52abc0 SDL-1.3

Merge trunk-1.3-3
author Sam Lantinga <slouken@libsdl.org>
date Wed, 17 May 2006 08:18:28 +0000
parents 97d0966f4bf7
children 782fd950bd46 c121d94672cb a1b03ba2fcd0
comparison
equal deleted inserted replaced
1658:e49147870aac 1659:14717b52abc0
166 } 166 }
167 167
168 168
169 /* Arguments and callback to setup and run the user thread function */ 169 /* Arguments and callback to setup and run the user thread function */
170 typedef struct { 170 typedef struct {
171 int (*func)(void *); 171 int (SDLCALL *func)(void *);
172 void *data; 172 void *data;
173 SDL_Thread *info; 173 SDL_Thread *info;
174 SDL_sem *wait; 174 SDL_sem *wait;
175 } thread_args; 175 } thread_args;
176 176
177 void SDL_RunThread(void *data) 177 void SDL_RunThread(void *data)
178 { 178 {
179 thread_args *args; 179 thread_args *args;
180 int (*userfunc)(void *); 180 int (SDLCALL *userfunc)(void *);
181 void *userdata; 181 void *userdata;
182 int *statusloc; 182 int *statusloc;
183 183
184 /* Perform any system-dependent setup 184 /* Perform any system-dependent setup
185 - this function cannot fail, and cannot use SDL_SetError() 185 - this function cannot fail, and cannot use SDL_SetError()
202 *statusloc = userfunc(userdata); 202 *statusloc = userfunc(userdata);
203 } 203 }
204 204
205 #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD 205 #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
206 #undef SDL_CreateThread 206 #undef SDL_CreateThread
207 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) 207 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
208 #else 208 #else
209 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data) 209 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data)
210 #endif 210 #endif
211 { 211 {
212 SDL_Thread *thread; 212 SDL_Thread *thread;
213 thread_args *args; 213 thread_args *args;
214 int ret; 214 int ret;