Work on systems without sa_sigaction.
This commit is contained in:
parent
1a862ae6d3
commit
4b70200bf8
3 changed files with 12 additions and 0 deletions
|
@ -236,6 +236,8 @@ if test x$enable_libc = xyes; then
|
|||
|
||||
AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
|
||||
AC_CHECK_FUNCS(iconv)
|
||||
|
||||
AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(void*)
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
#undef HAVE_SINF
|
||||
#undef HAVE_SQRT
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SA_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_SYSCONF
|
||||
|
|
|
@ -49,12 +49,21 @@ SDL_QuitInit(void)
|
|||
#ifdef HAVE_SIGACTION
|
||||
struct sigaction action;
|
||||
sigaction(SIGINT, NULL, &action);
|
||||
#ifdef HAVE_SA_SIGACTION
|
||||
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
|
||||
#else
|
||||
if ( action.sa_handler == SIG_DFL ) {
|
||||
#endif
|
||||
action.sa_handler = SDL_HandleSIG;
|
||||
sigaction(SIGINT, &action, NULL);
|
||||
}
|
||||
sigaction(SIGTERM, NULL, &action);
|
||||
|
||||
#ifdef HAVE_SA_SIGACTION
|
||||
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
|
||||
#else
|
||||
if ( action.sa_handler == SIG_DFL ) {
|
||||
#endif
|
||||
action.sa_handler = SDL_HandleSIG;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue