Source
Edit
This modules registers a signal handler that turns access violations / segfaults into a NilAccessDefect exception. To be able to catch a NilAccessDefect all you have to do is to import this module.
Tested on these OSes: Linux, Windows, OSX
proc c_abort() {.importc: "abort", header: "<stdlib.h>", noSideEffect, noreturn,
...raises: [], tags: [], forbids: [].}
-
Source
Edit
proc c_free(p: pointer) {.importc: "free", header: "<stdlib.h>", ...raises: [],
tags: [], forbids: [].}
-
Source
Edit
proc c_printf(frmt: cstring): cint {.importc: "printf", header: "<stdio.h>",
varargs, discardable, ...raises: [], tags: [],
forbids: [].}
-
Source
Edit
proc c_signal(sign: cint; handler: CSighandlerT): CSighandlerT {.
importc: "signal", header: "<signal.h>", discardable, ...raises: [], tags: [],
forbids: [].}
-
Source
Edit
proc c_sprintf(buf, frmt: cstring): cint {.importc: "sprintf",
header: "<stdio.h>", varargs, noSideEffect, ...raises: [], tags: [],
forbids: [].}
-
Source
Edit