summaryrefslogtreecommitdiff
path: root/include/sane/sanei_signal.h
blob: 0033c1c9f24d5b727986a7cc5a129505ef363b21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 */