changeset 4866:f42e8db53f78

Added a typedef for the thread function to simplify documentation
author Sam Lantinga <slouken@libsdl.org>
date Sat, 28 Aug 2010 22:56:52 -0700
parents fff50e86c891
children ba7492f9e2b8
files include/SDL_thread.h
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_thread.h	Mon Aug 23 23:44:28 2010 -0700
+++ b/include/SDL_thread.h	Sat Aug 28 22:56:52 2010 -0700
@@ -50,6 +50,11 @@
 /* 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 @@
  *  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 @@
  *  Create a thread.
  */
 extern DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThread(int (SDLCALL * fn) (void *), void *data);
+SDL_CreateThread(SDL_ThreadFunction fn, void *data);
 
 #endif