Mercurial > sdl-ios-xcode
comparison src/SDL.c @ 3269:a67a961e2171
Removed outdated OS/2 support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 19 Sep 2009 06:43:45 +0000 |
parents | 5db962a9a991 |
children | 63d4517fc4ac |
comparison
equal
deleted
inserted
replaced
3268:82ce350be859 | 3269:a67a961e2171 |
---|---|
275 SDL_GetRevision(void) | 275 SDL_GetRevision(void) |
276 { | 276 { |
277 return SDL_REVISION; | 277 return SDL_REVISION; |
278 } | 278 } |
279 | 279 |
280 #if defined(__OS2__) | 280 #if defined(__WIN32__) |
281 /* Building for OS/2 */ | |
282 #ifdef __WATCOMC__ | |
283 | |
284 #define INCL_DOSERRORS | |
285 #define INCL_DOSEXCEPTIONS | |
286 #include <os2.h> | |
287 | |
288 /* Exception handler to prevent the Audio thread hanging, making a zombie process! */ | |
289 ULONG _System | |
290 SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec, | |
291 PEXCEPTIONREGISTRATIONRECORD pERegRec, | |
292 PCONTEXTRECORD pCtxRec, PVOID p) | |
293 { | |
294 if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) | |
295 return XCPT_CONTINUE_SEARCH; | |
296 if (pERepRec->fHandlerFlags & EH_UNWINDING) | |
297 return XCPT_CONTINUE_SEARCH; | |
298 if (pERepRec->fHandlerFlags & EH_NESTED_CALL) | |
299 return XCPT_CONTINUE_SEARCH; | |
300 | |
301 /* Do cleanup at every fatal exception! */ | |
302 if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == | |
303 XCPT_FATAL_EXCEPTION) && (pERepRec->ExceptionNum != XCPT_BREAKPOINT) | |
304 && (pERepRec->ExceptionNum != XCPT_SINGLE_STEP)) { | |
305 if (SDL_initialized & SDL_INIT_AUDIO) { | |
306 /* This removes the zombie audio thread in case of emergency. */ | |
307 #ifdef DEBUG_BUILD | |
308 printf | |
309 ("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n"); | |
310 #endif | |
311 SDL_CloseAudio(); | |
312 } | |
313 } | |
314 return (XCPT_CONTINUE_SEARCH); | |
315 } | |
316 | |
317 | |
318 EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = | |
319 { 0, SDL_Main_ExceptionHandler }; | |
320 | |
321 /* The main DLL entry for DLL Initialization and Uninitialization: */ | |
322 unsigned _System | |
323 LibMain(unsigned hmod, unsigned termination) | |
324 { | |
325 if (termination) { | |
326 #ifdef DEBUG_BUILD | |
327 /* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */ | |
328 #endif | |
329 DosUnsetExceptionHandler(&SDL_Main_xcpthand); | |
330 return 1; | |
331 } else { | |
332 #ifdef DEBUG_BUILD | |
333 /* Make stdout and stderr unbuffered! */ | |
334 setbuf(stdout, NULL); | |
335 setbuf(stderr, NULL); | |
336 #endif | |
337 /* Fire up exception handler */ | |
338 #ifdef DEBUG_BUILD | |
339 /* printf("[SDL DLL Initialization] : Setting exception handler\n"); */ | |
340 #endif | |
341 /* Set exception handler */ | |
342 DosSetExceptionHandler(&SDL_Main_xcpthand); | |
343 | |
344 return 1; | |
345 } | |
346 } | |
347 #endif /* __WATCOMC__ */ | |
348 | |
349 #elif defined(__WIN32__) | |
350 | 281 |
351 #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) | 282 #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) |
352 /* Need to include DllMain() on Watcom C for some reason.. */ | 283 /* Need to include DllMain() on Watcom C for some reason.. */ |
353 #define WIN32_LEAN_AND_MEAN | 284 #define WIN32_LEAN_AND_MEAN |
354 #include <windows.h> | 285 #include <windows.h> |
366 } | 297 } |
367 return TRUE; | 298 return TRUE; |
368 } | 299 } |
369 #endif /* building DLL with Watcom C */ | 300 #endif /* building DLL with Watcom C */ |
370 | 301 |
371 #endif /* OS/2 elif __WIN32__ */ | 302 #endif /* __WIN32__ */ |
372 | 303 |
373 /* vi: set ts=4 sw=4 expandtab: */ | 304 /* vi: set ts=4 sw=4 expandtab: */ |