include/SDL_thread.h
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1471 9fb0eee04dd9
child 1668 4da1ee79c9af
     1.1 --- a/include/SDL_thread.h	Sun May 21 17:27:13 2006 +0000
     1.2 +++ b/include/SDL_thread.h	Sun May 28 13:04:16 2006 +0000
     1.3 @@ -23,10 +23,11 @@
     1.4  #ifndef _SDL_thread_h
     1.5  #define _SDL_thread_h
     1.6  
     1.7 -/* Header for the SDL thread management routines 
     1.8 -
     1.9 -	These are independent of the other SDL routines.
    1.10 -*/
    1.11 +/**
    1.12 + * \file SDL_thread.h
    1.13 + *
    1.14 + * Header for the SDL thread management routines 
    1.15 + */
    1.16  
    1.17  #include "SDL_stdinc.h"
    1.18  #include "SDL_error.h"
    1.19 @@ -37,7 +38,9 @@
    1.20  #include "begin_code.h"
    1.21  /* Set up for C function definitions, even when using C++ */
    1.22  #ifdef __cplusplus
    1.23 +/* *INDENT-OFF* */
    1.24  extern "C" {
    1.25 +/* *INDENT-ON* */
    1.26  #endif
    1.27  
    1.28  /* The SDL thread structure, defined in SDL_thread.c */
    1.29 @@ -61,25 +64,39 @@
    1.30  */
    1.31  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
    1.32  #ifndef _WIN32_WCE
    1.33 -#include <process.h> /* This has _beginthread() and _endthread() defined! */
    1.34 +#include <process.h>            /* This has _beginthread() and _endthread() defined! */
    1.35  #endif
    1.36  
    1.37  #ifdef __OS2__
    1.38 -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
    1.39 -typedef void (*pfnSDL_CurrentEndThread)(void);
    1.40 +typedef int (*pfnSDL_CurrentBeginThread) (void (*func) (void *), void *,
    1.41 +                                          unsigned, void *arg);
    1.42 +typedef void (*pfnSDL_CurrentEndThread) (void);
    1.43  #elif __GNUC__
    1.44 -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.45 -        unsigned (__stdcall *func)(void *), void *arg, 
    1.46 -        unsigned, unsigned *threadID);
    1.47 -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
    1.48 +typedef unsigned long (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.49 +                                                             unsigned
    1.50 +                                                             (__stdcall *
    1.51 +                                                              func) (void *),
    1.52 +                                                             void *arg,
    1.53 +                                                             unsigned,
    1.54 +                                                             unsigned
    1.55 +                                                             *threadID);
    1.56 +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
    1.57  #else
    1.58 -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.59 -        unsigned (__stdcall *func)(void *), void *arg, 
    1.60 -        unsigned, unsigned *threadID);
    1.61 -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
    1.62 +typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.63 +                                                         unsigned (__stdcall *
    1.64 +                                                                   func) (void
    1.65 +                                                                          *),
    1.66 +                                                         void *arg, unsigned,
    1.67 +                                                         unsigned *threadID);
    1.68 +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
    1.69  #endif
    1.70  
    1.71 -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
    1.72 +extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread (int (*fn) (void *),
    1.73 +                                                      void *data,
    1.74 +                                                      pfnSDL_CurrentBeginThread
    1.75 +                                                      pfnBeginThread,
    1.76 +                                                      pfnSDL_CurrentEndThread
    1.77 +                                                      pfnEndThread);
    1.78  
    1.79  #ifdef __OS2__
    1.80  #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
    1.81 @@ -89,31 +106,37 @@
    1.82  #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
    1.83  #endif
    1.84  #else
    1.85 -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
    1.86 +extern DECLSPEC SDL_Thread *SDLCALL
    1.87 +SDL_CreateThread (int (SDLCALL * fn) (void *), void *data);
    1.88  #endif
    1.89  
    1.90  /* Get the 32-bit thread identifier for the current thread */
    1.91 -extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
    1.92 +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID (void);
    1.93  
    1.94  /* Get the 32-bit thread identifier for the specified thread,
    1.95     equivalent to SDL_ThreadID() if the specified thread is NULL.
    1.96   */
    1.97 -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
    1.98 +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID (SDL_Thread * thread);
    1.99  
   1.100  /* Wait for a thread to finish.
   1.101     The return code for the thread function is placed in the area
   1.102     pointed to by 'status', if 'status' is not NULL.
   1.103   */
   1.104 -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
   1.105 +extern DECLSPEC void SDLCALL SDL_WaitThread (SDL_Thread * thread,
   1.106 +                                             int *status);
   1.107  
   1.108  /* Forcefully kill a thread without worrying about its state */
   1.109 -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
   1.110 +extern DECLSPEC void SDLCALL SDL_KillThread (SDL_Thread * thread);
   1.111  
   1.112  
   1.113  /* Ends C function definitions when using C++ */
   1.114  #ifdef __cplusplus
   1.115 +/* *INDENT-OFF* */
   1.116  }
   1.117 +/* *INDENT-ON* */
   1.118  #endif
   1.119  #include "close_code.h"
   1.120  
   1.121  #endif /* _SDL_thread_h */
   1.122 +
   1.123 +/* vi: set ts=4 sw=4 expandtab: */