Added a typedef for the thread function to simplify documentation
authorSam Lantinga <slouken@libsdl.org>
Sat, 28 Aug 2010 22:56:52 -0700
changeset 4866 f42e8db53f78
parent 4865 fff50e86c891
child 4867 ba7492f9e2b8
Added a typedef for the thread function to simplify documentation
include/SDL_thread.h
--- 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