Check sa_sigaction member of struct sigaction SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Thu, 14 Jul 2011 15:40:07 +0200
branchSDL-1.2
changeset 5565 4225f09eb8cb
parent 5561 62269926f506
child 5568 abe7d0b3539b
Check sa_sigaction member of struct sigaction
configure.in
src/events/SDL_quit.c
--- a/configure.in	Wed Jul 13 17:36:29 2011 -0700
+++ b/configure.in	Thu Jul 14 15:40:07 2011 +0200
@@ -185,6 +185,8 @@
 
     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 <signal.h>])
 fi
 
 if test x$have_inttypes != xyes; then
--- a/src/events/SDL_quit.c	Wed Jul 13 17:36:29 2011 -0700
+++ b/src/events/SDL_quit.c	Thu Jul 14 15:40:07 2011 +0200
@@ -48,12 +48,20 @@
 #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);
 	}