Skip to content

Commit

Permalink
Implemented SDL_CreateThread().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 12, 2013
1 parent 0f5863c commit c3125a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/SDL12_compat.c
Expand Up @@ -36,7 +36,6 @@
//#include "render/SDL_yuv_sw_c.h"

// !!! IMPLEMENT_ME SDL_ConvertSurface
// !!! IMPLEMENT_ME SDL_CreateThread
// !!! IMPLEMENT_ME SDL_EventState
// !!! IMPLEMENT_ME SDL_GL_GetAttribute
// !!! IMPLEMENT_ME SDL_GL_Lock
Expand Down Expand Up @@ -2806,6 +2805,22 @@ int SDL_CDStop(SDL12_CD *cdrom) { return CDUnsupported(); }
int SDL_CDEject(SDL12_CD *cdrom) { return CDUnsupported(); }
void SDL_CDClose(SDL12_CD *cdrom) {}


#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
SDL_Thread *
SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
{
return SDL20_CreateThread(fn, NULL, data, pfnBeginThread, pfnEndThread);
}
#else
SDL_Thread *
SDL_CreateThread(int (SDLCALL *fn)(void *), void *data)
{
return SDL20_CreateThread(fn, NULL, data);
}
#endif


/* !!! FIXME: Removed from 2.0; do nothing. We can't even report failure. */
void SDL_KillThread(SDL_Thread *thread) {}

Expand Down
6 changes: 6 additions & 0 deletions src/SDL20_syms.h
Expand Up @@ -56,6 +56,12 @@ SDL20_SYM(void,SetCursor,(SDL_Cursor *a),(a),)
SDL20_SYM(SDL_Cursor *,GetCursor,(void),(),return)
SDL20_SYM(void,FreeCursor,(SDL_Cursor *a),(a),)

#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
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)
#else
SDL20_SYM(SDL_Thread *,CreateThread,(SDL_ThreadFunction a, const char *b, void *c),(a,b,c),return)
#endif

SDL20_SYM_PASSTHROUGH(Uint32,GetThreadID,(SDL_Thread *a),(a),return)
SDL20_SYM_PASSTHROUGH(Uint32,ThreadID,(void),(),return)
SDL20_SYM_PASSTHROUGH(void,WaitThread,(SDL_Thread *a, int *b),(a,b),)
Expand Down

0 comments on commit c3125a6

Please sign in to comment.