New module 'unicase/ulc-casecoll'.
[pspp] / lib / sigaction.c
index 1bad8092f2795077329db8ed282fbcfca6872805..5fcd3ed9ad6a89f00e7a14c47b8fd67b37a01f1a 100644 (file)
 # define SIGSTOP (-1)
 #endif
 
+/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
+   for the signal SIGABRT.  Only one signal handler is stored for both
+   SIGABRT and SIGABRT_COMPAT.  SIGABRT_COMPAT is not a signal of its own.  */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# undef SIGABRT_COMPAT
+# define SIGABRT_COMPAT 6
+#endif
+
 /* A signal handler.  */
 typedef void (*handler_t) (int signal);
 
@@ -134,6 +142,11 @@ sigaction (int sig, const struct sigaction *restrict act,
       return -1;
     }
 
+  #ifdef SIGABRT_COMPAT
+  if (sig == SIGABRT_COMPAT)
+    sig = SIGABRT;
+  #endif
+
   /* POSIX requires sigaction() to be async-signal-safe.  In other
      words, if an asynchronous signal can occur while we are anywhere
      inside this function, the user's handler could then call