include/SDL_thread.h
changeset 1895 c121d94672cb
parent 1850 d5d3a6fe05a1
child 2049 5f6550e5184f
     1.1 --- a/include/SDL_thread.h	Thu Jul 06 18:01:37 2006 +0000
     1.2 +++ b/include/SDL_thread.h	Mon Jul 10 21:04:37 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 (SDLCALL *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,7 +106,8 @@
    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 @@ -98,22 +116,26 @@
    1.92  /* Get the 32-bit thread identifier for the specified thread,
    1.93     equivalent to SDL_ThreadID() if the specified thread is NULL.
    1.94   */
    1.95 -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
    1.96 +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread * thread);
    1.97  
    1.98  /* Wait for a thread to finish.
    1.99     The return code for the thread function is placed in the area
   1.100     pointed to by 'status', if 'status' is not NULL.
   1.101   */
   1.102 -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
   1.103 +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
   1.104  
   1.105  /* Forcefully kill a thread without worrying about its state */
   1.106 -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
   1.107 +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread);
   1.108  
   1.109  
   1.110  /* Ends C function definitions when using C++ */
   1.111  #ifdef __cplusplus
   1.112 +/* *INDENT-OFF* */
   1.113  }
   1.114 +/* *INDENT-ON* */
   1.115  #endif
   1.116  #include "close_code.h"
   1.117  
   1.118  #endif /* _SDL_thread_h */
   1.119 +
   1.120 +/* vi: set ts=4 sw=4 expandtab: */