summaryrefslogtreecommitdiff
path: root/include/sanei_signal.h
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:01 +0000
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:01 +0000
commite7e90b72fd3161c5d55fed49e100781dfa3e9408 (patch)
tree67cfcfae6b9a9e15701a332dfacbe0ca6440f16c /include/sanei_signal.h
parent2d113e8792747151bf5d830f1a1485f2f951f940 (diff)
Imported Upstream version 0.84upstream/0.84
Diffstat (limited to 'include/sanei_signal.h')
-rw-r--r--include/sanei_signal.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/sanei_signal.h b/include/sanei_signal.h
new file mode 100644
index 0000000..0033c1c
--- /dev/null
+++ b/include/sanei_signal.h
@@ -0,0 +1,50 @@
+#ifdef HAVE_SIGPROCMASK
+# define SIGACTION sigaction
+#else
+
+/* Just enough backwards compatibility that we get by in the backends
+ without making handstands. */
+# ifdef sigset_t
+# undef sigset_t
+# endif
+# ifdef sigemptyset
+# undef sigemptyset
+# endif
+# ifdef sigfillset
+# undef sigfillset
+# endif
+# ifdef sigaddset
+# undef sigaddset
+# endif
+# ifdef sigdelset
+# undef sigdelset
+# endif
+# ifdef sigprocmask
+# undef sigprocmask
+# endif
+# ifdef SIG_BLOCK
+# undef SIG_BLOCK
+# endif
+# ifdef SIG_UNBLOCK
+# undef SIG_UNBLOCK
+# endif
+# ifdef SIG_SETMASK
+# undef SIG_SETMASK
+# endif
+
+# define sigset_t int
+# define sigemptyset(set) do { *(set) = 0; } while (0)
+# define sigfillset(set) do { *(set) = ~0; } while (0)
+# define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0)
+# define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
+# define sigaction(sig,new,old) sigvec (sig,new,old)
+
+ /* Note: it's not safe to just declare our own "struct sigaction" since
+ some systems (e.g., some versions of OpenStep) declare that structure,
+ but do not implement sigprocmask(). Hard to believe, aint it? */
+# define SIGACTION sigvec
+# define SIG_BLOCK 1
+# define SIG_UNBLOCK 2
+# define SIG_SETMASK 3
+#endif /* !HAVE_SIGPROCMASK */
+