Skip to content

Commit 8cd4248

Browse files
committed
Make SIG_DFL / SIG_IGN C++ compatible
1 parent d721ff8 commit 8cd4248

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dsp/tty/ttyraw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static relegated void ttyraw_onsig(int sig, struct siginfo *info,
9797
}
9898
for (i = 0; i < ARRAYLEN(g_ttyraw.sigs); ++i) {
9999
if (g_ttyraw.sigs[i] == sig) {
100-
if (g_ttyraw.next[i] != SIG_IGN) {
101-
if (g_ttyraw.next[i] != SIG_DFL) {
100+
if (g_ttyraw.next[i] != (void *)SIG_IGN) {
101+
if (g_ttyraw.next[i] != (void *)SIG_DFL) {
102102
if (g_ttyraw.next[i]) {
103103
g_ttyraw.next[i](sig, info, ctx);
104104
}
@@ -117,7 +117,7 @@ static textstartup void ttyraw_initsig(int sig, unsigned flags, unsigned mask) {
117117
struct sigaction old;
118118
g_ttyraw.next[i] = xsigaction(sig, ttyraw_onsig, flags, mask, &old) != -1
119119
? old.sa_sigaction
120-
: SIG_DFL;
120+
: (void *)SIG_DFL;
121121
g_ttyraw.sigs[i++] = sig;
122122
}
123123

libc/calls/calls.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
1818

1919
#define SIG_ERR ((void (*)(int))(-1))
20-
#define SIG_DFL ((void *)0)
21-
#define SIG_IGN ((void *)1)
20+
#define SIG_DFL ((void (*)(int))0)
21+
#define SIG_IGN ((void (*)(int))1)
2222

2323
#define MAP_FAILED ((void *)-1)
2424

0 commit comments

Comments
 (0)