mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
make --define:noSignalHandler compile again
This commit is contained in:
@@ -3463,7 +3463,7 @@ when not defined(JS): #and not defined(nimscript):
|
||||
## allows you to override the behaviour of your application when CTRL+C
|
||||
## is pressed. Only one such hook is supported.
|
||||
|
||||
when not defined(useNimRtl):
|
||||
when not defined(noSignalHandler) and not defined(useNimRtl):
|
||||
proc unsetControlCHook*()
|
||||
## reverts a call to setControlCHook
|
||||
|
||||
|
||||
@@ -537,7 +537,7 @@ proc setControlCHook(hook: proc () {.noconv.}) =
|
||||
type SignalHandler = proc (sign: cint) {.noconv, benign.}
|
||||
c_signal(SIGINT, cast[SignalHandler](hook))
|
||||
|
||||
when not defined(useNimRtl):
|
||||
when not defined(noSignalHandler) and not defined(useNimRtl):
|
||||
proc unsetControlCHook() =
|
||||
# proc to unset a hook set by setControlCHook
|
||||
c_signal(SIGINT, signalHandler)
|
||||
|
||||
Reference in New Issue
Block a user