Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added a typedef for the thread function to simplify documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 29, 2010
1 parent 8e558b0 commit 28304ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/SDL_thread.h
Expand Up @@ -50,6 +50,11 @@ typedef struct SDL_Thread SDL_Thread;
/* The SDL thread ID */
typedef unsigned long SDL_threadID;

/* The function passed to SDL_CreateThread()
It is passed a void* user context parameter and returns an int.
*/
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);

#if defined(__WIN32__) && !defined(HAVE_LIBC)
/**
* \file SDL_thread.h
Expand Down Expand Up @@ -100,7 +105,7 @@ typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
* Create a thread.
*/
extern DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThread(int (SDLCALL * f) (void *), void *data,
SDL_CreateThread(SDL_ThreadFunction fn, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread);

Expand All @@ -125,7 +130,7 @@ SDL_CreateThread(int (SDLCALL * f) (void *), void *data,
* Create a thread.
*/
extern DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThread(int (SDLCALL * fn) (void *), void *data);
SDL_CreateThread(SDL_ThreadFunction fn, void *data);

#endif

Expand Down

0 comments on commit 28304ee

Please sign in to comment.