Skip to content

Commit

Permalink
Fixed bug 3842 - fix SDL_thread.h for emx
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
slouken committed Sep 23, 2017
1 parent 14ed0d2 commit c44e741
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions include/SDL_thread.h
Expand Up @@ -90,14 +90,11 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
* library!
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#include <process.h> /* This has _beginthread() and _endthread() defined! */

typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *
func) (void
*),
void *arg, unsigned,
unsigned *threadID);
#include <process.h> /* _beginthreadex() and _endthreadex() */

typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread)
(void *, unsigned, unsigned (__stdcall *func)(void *),
void * /*arg*/, unsigned, unsigned * /* threadID */);
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);

/**
Expand All @@ -124,7 +121,11 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
* into a dll with Watcom's runtime statically linked.
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#ifndef __EMX__
#include <process.h>
#else
#include <stdlib.h>
#endif
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
typedef void (*pfnSDL_CurrentEndThread)(void);
extern DECLSPEC SDL_Thread *SDLCALL
Expand Down

0 comments on commit c44e741

Please sign in to comment.