diff options
Diffstat (limited to 'apps/plugins/sdl/src/SDL.c')
-rw-r--r-- | apps/plugins/sdl/src/SDL.c | 95 |
1 files changed, 0 insertions, 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) | |||
253 | { | 253 | { |
254 | return(&version); | 254 | return(&version); |
255 | } | 255 | } |
256 | |||
257 | #if defined(__OS2__) | ||
258 | /* Building for OS/2 */ | ||
259 | #ifdef __WATCOMC__ | ||
260 | |||
261 | #define INCL_DOSERRORS | ||
262 | #define INCL_DOSEXCEPTIONS | ||
263 | #include <os2.h> | ||
264 | |||
265 | /* Exception handler to prevent the Audio thread hanging, making a zombie process! */ | ||
266 | ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec, | ||
267 | PEXCEPTIONREGISTRATIONRECORD pERegRec, | ||
268 | PCONTEXTRECORD pCtxRec, | ||
269 | PVOID p) | ||
270 | { | ||
271 | if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) | ||
272 | return XCPT_CONTINUE_SEARCH; | ||
273 | if (pERepRec->fHandlerFlags & EH_UNWINDING) | ||
274 | return XCPT_CONTINUE_SEARCH; | ||
275 | if (pERepRec->fHandlerFlags & EH_NESTED_CALL) | ||
276 | return XCPT_CONTINUE_SEARCH; | ||
277 | |||
278 | /* Do cleanup at every fatal exception! */ | ||
279 | if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) && | ||
280 | (pERepRec->ExceptionNum != XCPT_BREAKPOINT) && | ||
281 | (pERepRec->ExceptionNum != XCPT_SINGLE_STEP) | ||
282 | ) | ||
283 | { | ||
284 | if (SDL_initialized & SDL_INIT_AUDIO) | ||
285 | { | ||
286 | /* This removes the zombie audio thread in case of emergency. */ | ||
287 | #ifdef DEBUG_BUILD | ||
288 | printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n"); | ||
289 | #endif | ||
290 | SDL_CloseAudio(); | ||
291 | } | ||
292 | } | ||
293 | return (XCPT_CONTINUE_SEARCH); | ||
294 | } | ||
295 | |||
296 | |||
297 | EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler}; | ||
298 | |||
299 | /* The main DLL entry for DLL Initialization and Uninitialization: */ | ||
300 | unsigned _System LibMain(unsigned hmod, unsigned termination) | ||
301 | { | ||
302 | if (termination) | ||
303 | { | ||
304 | #ifdef DEBUG_BUILD | ||
305 | /* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */ | ||
306 | #endif | ||
307 | DosUnsetExceptionHandler(&SDL_Main_xcpthand); | ||
308 | return 1; | ||
309 | } else | ||
310 | { | ||
311 | #ifdef DEBUG_BUILD | ||
312 | /* Make stdout and stderr unbuffered! */ | ||
313 | setbuf(stdout, NULL); | ||
314 | setbuf(stderr, NULL); | ||
315 | #endif | ||
316 | /* Fire up exception handler */ | ||
317 | #ifdef DEBUG_BUILD | ||
318 | /* printf("[SDL DLL Initialization] : Setting exception handler\n"); */ | ||
319 | #endif | ||
320 | /* Set exception handler */ | ||
321 | DosSetExceptionHandler(&SDL_Main_xcpthand); | ||
322 | |||
323 | return 1; | ||
324 | } | ||
325 | } | ||
326 | #endif /* __WATCOMC__ */ | ||
327 | |||
328 | #elif defined(__WIN32__) && !defined(__SYMBIAN32__) | ||
329 | |||
330 | #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) | ||
331 | /* Need to include DllMain() on Watcom C for some reason.. */ | ||
332 | #define WIN32_LEAN_AND_MEAN | ||
333 | #include <windows.h> | ||
334 | |||
335 | BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, | ||
336 | DWORD ul_reason_for_call, | ||
337 | LPVOID lpReserved ) | ||
338 | { | ||
339 | switch (ul_reason_for_call) { | ||
340 | case DLL_PROCESS_ATTACH: | ||
341 | case DLL_THREAD_ATTACH: | ||
342 | case DLL_THREAD_DETACH: | ||
343 | case DLL_PROCESS_DETACH: | ||
344 | break; | ||
345 | } | ||
346 | return TRUE; | ||
347 | } | ||
348 | #endif /* building DLL with Watcom C */ | ||
349 | |||
350 | #endif /* OS/2 elif __WIN32__ */ | ||