From 28304ee0c51c7ef98aa70092dfe17f8d05a66be2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 28 Aug 2010 22:56:52 -0700 Subject: [PATCH] Added a typedef for the thread function to simplify documentation --- include/SDL_thread.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/SDL_thread.h b/include/SDL_thread.h index cca172dee..1c8a76a25 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -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 @@ -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); @@ -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