c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
importc here is needed to ensure that the C typedef is used where relevant, and not the thing that Nim thinks is equivalent: Nim lacks the language to represent const void* correctly - this leads to compile issues down the line with const-vs-non-const type problems.
The above should be SomeProc* {.importc: "some_proc", header: "test.h".} = proc (key: pointer) {.cdecl.}
importc
here is needed to ensure that theC
typedef is used where relevant, and not the thing that Nim thinks is equivalent: Nim lacks the language to representconst void*
correctly - this leads to compile issues down the line with const-vs-non-const type problems.The above should be
SomeProc* {.importc: "some_proc", header: "test.h".} = proc (key: pointer) {.cdecl.}