Implemented SDL_CreateThread().
authorRyan C. Gordon <icculus@icculus.org>
Thu, 11 Apr 2013 21:27:04 -0400
changeset 2634c2ae82780a
parent 25 2dfd8573dba0
child 27 4b3e208d2c10
Implemented SDL_CreateThread().
src/SDL12_compat.c
src/SDL20_syms.h
     1.1 --- a/src/SDL12_compat.c	Thu Apr 11 00:37:09 2013 -0400
     1.2 +++ b/src/SDL12_compat.c	Thu Apr 11 21:27:04 2013 -0400
     1.3 @@ -36,7 +36,6 @@
     1.4  //#include "render/SDL_yuv_sw_c.h"
     1.5  
     1.6  // !!! IMPLEMENT_ME SDL_ConvertSurface
     1.7 -// !!! IMPLEMENT_ME SDL_CreateThread
     1.8  // !!! IMPLEMENT_ME SDL_EventState
     1.9  // !!! IMPLEMENT_ME SDL_GL_GetAttribute
    1.10  // !!! IMPLEMENT_ME SDL_GL_Lock
    1.11 @@ -2806,6 +2805,22 @@
    1.12  int SDL_CDEject(SDL12_CD *cdrom) { return CDUnsupported(); }
    1.13  void SDL_CDClose(SDL12_CD *cdrom) {}
    1.14  
    1.15 +
    1.16 +#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
    1.17 +SDL_Thread *
    1.18 +SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
    1.19 +{
    1.20 +    return SDL20_CreateThread(fn, NULL, data, pfnBeginThread, pfnEndThread);
    1.21 +}
    1.22 +#else
    1.23 +SDL_Thread *
    1.24 +SDL_CreateThread(int (SDLCALL *fn)(void *), void *data)
    1.25 +{
    1.26 +    return SDL20_CreateThread(fn, NULL, data);
    1.27 +}
    1.28 +#endif
    1.29 +
    1.30 +
    1.31  /* !!! FIXME: Removed from 2.0; do nothing. We can't even report failure. */
    1.32  void SDL_KillThread(SDL_Thread *thread) {}
    1.33  
     2.1 --- a/src/SDL20_syms.h	Thu Apr 11 00:37:09 2013 -0400
     2.2 +++ b/src/SDL20_syms.h	Thu Apr 11 21:27:04 2013 -0400
     2.3 @@ -56,6 +56,12 @@
     2.4  SDL20_SYM(SDL_Cursor *,GetCursor,(void),(),return)
     2.5  SDL20_SYM(void,FreeCursor,(SDL_Cursor *a),(a),)
     2.6  
     2.7 +#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
     2.8 +SDL20_SYM(SDL_Thread *,CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return)
     2.9 +#else
    2.10 +SDL20_SYM(SDL_Thread *,CreateThread,(SDL_ThreadFunction a, const char *b, void *c),(a,b,c),return)
    2.11 +#endif
    2.12 +
    2.13  SDL20_SYM_PASSTHROUGH(Uint32,GetThreadID,(SDL_Thread *a),(a),return)
    2.14  SDL20_SYM_PASSTHROUGH(Uint32,ThreadID,(void),(),return)
    2.15  SDL20_SYM_PASSTHROUGH(void,WaitThread,(SDL_Thread *a, int *b),(a,b),)