From d8330c9c18ac227800ed7dc9c6ae72946e92e4fb Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 28 Jul 2019 14:27:49 -0400 Subject: [PATCH] sdl: gut OS/2, win32 code from SDL.c This should help with compiling win32 simulators. Change-Id: Icfbf78f7d0a8b0ddebffa8daac3adf55ac21f139 --- apps/plugins/sdl/src/SDL.c | 95 -------------------------------------- 1 file changed, 95 deletions(-) diff --git a/apps/plugins/sdl/src/SDL.c b/apps/plugins/sdl/src/SDL.c index 87f1b1af2a..bdd5c6d0d1 100644 --- a/apps/plugins/sdl/src/SDL.c +++ b/apps/plugins/sdl/src/SDL.c @@ -253,98 +253,3 @@ const SDL_version * SDL_Linked_Version(void) { return(&version); } - -#if defined(__OS2__) -/* Building for OS/2 */ -#ifdef __WATCOMC__ - -#define INCL_DOSERRORS -#define INCL_DOSEXCEPTIONS -#include - -/* Exception handler to prevent the Audio thread hanging, making a zombie process! */ -ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec, - PEXCEPTIONREGISTRATIONRECORD pERegRec, - PCONTEXTRECORD pCtxRec, - PVOID p) -{ - if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) - return XCPT_CONTINUE_SEARCH; - if (pERepRec->fHandlerFlags & EH_UNWINDING) - return XCPT_CONTINUE_SEARCH; - if (pERepRec->fHandlerFlags & EH_NESTED_CALL) - return XCPT_CONTINUE_SEARCH; - - /* Do cleanup at every fatal exception! */ - if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) && - (pERepRec->ExceptionNum != XCPT_BREAKPOINT) && - (pERepRec->ExceptionNum != XCPT_SINGLE_STEP) - ) - { - if (SDL_initialized & SDL_INIT_AUDIO) - { - /* This removes the zombie audio thread in case of emergency. */ -#ifdef DEBUG_BUILD - printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n"); -#endif - SDL_CloseAudio(); - } - } - return (XCPT_CONTINUE_SEARCH); -} - - -EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler}; - -/* The main DLL entry for DLL Initialization and Uninitialization: */ -unsigned _System LibMain(unsigned hmod, unsigned termination) -{ - if (termination) - { -#ifdef DEBUG_BUILD -/* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */ -#endif - DosUnsetExceptionHandler(&SDL_Main_xcpthand); - return 1; - } else - { -#ifdef DEBUG_BUILD - /* Make stdout and stderr unbuffered! */ - setbuf(stdout, NULL); - setbuf(stderr, NULL); -#endif - /* Fire up exception handler */ -#ifdef DEBUG_BUILD -/* printf("[SDL DLL Initialization] : Setting exception handler\n"); */ -#endif - /* Set exception handler */ - DosSetExceptionHandler(&SDL_Main_xcpthand); - - return 1; - } -} -#endif /* __WATCOMC__ */ - -#elif defined(__WIN32__) && !defined(__SYMBIAN32__) - -#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) -/* Need to include DllMain() on Watcom C for some reason.. */ -#define WIN32_LEAN_AND_MEAN -#include - -BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved ) -{ - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} -#endif /* building DLL with Watcom C */ - -#endif /* OS/2 elif __WIN32__ */