I use this:
#mangle __faidx_t foo_faidx_t
And it generates:
type
foo_faidx_t* {.importc: "__faidx_t", header: "htslib/faidx.h", bycopy.} =
object
And I add "struct" manually, to this:
type
foo_faidx_t* {.importc: "struct __faidx_t", header: "htslib/faidx.h",
bycopy.} = object
