Fixed bug 3842 - fix SDL_thread.h for emx
authorSam Lantinga <slouken@libsdl.org>
Sat, 23 Sep 2017 12:38:47 -0700
changeset 1154353b03749a7ff
parent 11542 5c39c05ced36
child 11545 8ce1c541181d
Fixed bug 3842 - fix SDL_thread.h for emx

Ozkan Sezer

EMX declares _beginthread() / _endthread() in stdlib.h, not process.h.
The attached patch updates the OS/2 case of SDL_thread.h for it. (It
also tidies the unreadable whitespace in win32 case.)
include/SDL_thread.h
     1.1 --- a/include/SDL_thread.h	Sat Sep 23 12:37:09 2017 -0700
     1.2 +++ b/include/SDL_thread.h	Sat Sep 23 12:38:47 2017 -0700
     1.3 @@ -90,14 +90,11 @@
     1.4   *  library!
     1.5   */
     1.6  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
     1.7 -#include <process.h>            /* This has _beginthread() and _endthread() defined! */
     1.8 +#include <process.h> /* _beginthreadex() and _endthreadex() */
     1.9  
    1.10 -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.11 -                                                        unsigned (__stdcall *
    1.12 -                                                                  func) (void
    1.13 -                                                                         *),
    1.14 -                                                        void *arg, unsigned,
    1.15 -                                                        unsigned *threadID);
    1.16 +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread)
    1.17 +                   (void *, unsigned, unsigned (__stdcall *func)(void *),
    1.18 +                    void * /*arg*/, unsigned, unsigned * /* threadID */);
    1.19  typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
    1.20  
    1.21  /**
    1.22 @@ -124,7 +121,11 @@
    1.23   * into a dll with Watcom's runtime statically linked.
    1.24   */
    1.25  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
    1.26 +#ifndef __EMX__
    1.27  #include <process.h>
    1.28 +#else
    1.29 +#include <stdlib.h>
    1.30 +#endif
    1.31  typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
    1.32  typedef void (*pfnSDL_CurrentEndThread)(void);
    1.33  extern DECLSPEC SDL_Thread *SDLCALL