Open arnetheduck opened 2 years ago
let x {.importc.} <init missing>
is Nim's notion of "extern const". IIRC this was added for this reason.
is Nim's notion of "extern const"
right, I was testing this with nim 1.2 where it's not allowed - it's also still missing the actual importc
Header:
Command:
Output:
several problems with the generated definition:
importc: "xxx_symbol"
var
(becauselet
needs an initializer which in this case is not provided in nim (it's done in the C library typically)Of course, the main issue here is that Nim has no feature that expresses the concept of an
extern const
in general, sovar
is the closest that we can get.