It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005 --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401334
This commit is contained in:
parent
5372bfd326
commit
6c3f928cd8
101 changed files with 8882 additions and 601 deletions
|
@ -20,91 +20,27 @@
|
|||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#define NO_SIGNAL_H
|
||||
#endif
|
||||
|
||||
/* General fatal signal handling code for SDL */
|
||||
|
||||
#ifdef NO_SIGNAL_H
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* No signals on this platform, nothing to do.. */
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
|
||||
void SDL_InstallParachute(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void SDL_UninstallParachute(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_fatal.h"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#define DISABLE_STDIO
|
||||
#endif
|
||||
|
||||
/* This installs some signal handlers for the more common fatal signals,
|
||||
so that if the programmer is lazy, the app doesn't die so horribly if
|
||||
the program crashes.
|
||||
*/
|
||||
|
||||
static void print_msg(const char *text)
|
||||
{
|
||||
#ifndef DISABLE_STDIO
|
||||
fprintf(stderr, "%s", text);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SDL_Parachute(int sig)
|
||||
{
|
||||
signal(sig, SIG_DFL);
|
||||
print_msg("Fatal signal: ");
|
||||
switch (sig) {
|
||||
case SIGSEGV:
|
||||
print_msg("Segmentation Fault");
|
||||
break;
|
||||
#ifdef SIGBUS
|
||||
#if SIGBUS != SIGSEGV
|
||||
case SIGBUS:
|
||||
print_msg("Bus Error");
|
||||
break;
|
||||
#endif
|
||||
#endif /* SIGBUS */
|
||||
#ifdef SIGFPE
|
||||
case SIGFPE:
|
||||
print_msg("Floating Point Exception");
|
||||
break;
|
||||
#endif /* SIGFPE */
|
||||
#ifdef SIGQUIT
|
||||
case SIGQUIT:
|
||||
print_msg("Keyboard Quit");
|
||||
break;
|
||||
#endif /* SIGQUIT */
|
||||
#ifdef SIGPIPE
|
||||
case SIGPIPE:
|
||||
print_msg("Broken Pipe");
|
||||
break;
|
||||
#endif /* SIGPIPE */
|
||||
default:
|
||||
#ifndef DISABLE_STDIO
|
||||
fprintf(stderr, "# %d", sig);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
print_msg(" (SDL Parachute Deployed)\n");
|
||||
SDL_Quit();
|
||||
exit(-sig);
|
||||
raise(sig);
|
||||
}
|
||||
|
||||
static int SDL_fatal_signals[] = {
|
||||
|
@ -182,4 +118,18 @@ void SDL_UninstallParachute(void)
|
|||
#endif /* HAVE_SIGACTION */
|
||||
}
|
||||
|
||||
#endif /* NO_SIGNAL_H */
|
||||
#else
|
||||
|
||||
/* No signals on this platform, nothing to do.. */
|
||||
|
||||
void SDL_InstallParachute(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void SDL_UninstallParachute(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* HAVE_SIGNAL_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue