diff --git a/configure.in b/configure.in index be91920f5..c540b6fec 100644 --- a/configure.in +++ b/configure.in @@ -185,6 +185,8 @@ if test x$enable_libc = xyes; then AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) + + AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include ]) fi if test x$have_inttypes != xyes; then diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index 099b97112..2765aab8d 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -48,12 +48,20 @@ int 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); }