Skip to content

Instantly share code, notes, and snippets.

@Varriount
Created January 23, 2014 02:59
Show Gist options
  • Save Varriount/8572100 to your computer and use it in GitHub Desktop.
Save Varriount/8572100 to your computer and use it in GitHub Desktop.
proc setControlCHook(hook: proc () {.noconv.}) =
# ugly cast, but should work on all architectures:
type TSignalHandler = proc (sig: cint) {.noconv.}
c_signal(SIGINT, cast[TSignalHandler](hook))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment