Skip to content

Commit b91fab9

Browse files
committed
feat(inner): SIG* in pyconfig/signal
1 parent c2f9223 commit b91fab9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/pylib/pyconfig/signal.nim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,18 @@ const Py_NSIG* = from_c_int(Py_NSIG, 64):
2828
AC_LINK_IFELSE HAVE_STRSIGNAL, false:
2929
proc strsignal(signalnum: cint): cstring {.importc, header: "<string.h>".}
3030
discard strsignal(0)
31+
32+
const DEF_SIG* = low int ## we know int.low is smaller than low(cint)
33+
when not defined(windows):
34+
template SIG(sym) =
35+
const sym* = from_c_int(sym, "<signal.h>", DEF_SIG)
36+
37+
SIG SIGIOT
38+
SIG SIGEMT
39+
SIG SIGCLD
40+
SIG SIGPWR
41+
SIG SIGIO
42+
SIG SIGWINCH
43+
SIG SIGRTMIN
44+
SIG SIGRTMAX
45+
SIG SIGSTKFLT

0 commit comments

Comments
 (0)