type
VSAPI* {.bycopy.} = object
...
propSetIntArray*: proc(map:ptr VSMap, key:cstring, i:ptr int64, size:cint):cint
...
I want to make easier to deal with it with something like the following:
proc propSetIntArray(vsmap:ptr VSMap, key:string, arr:seq[int]) =
let p = cast[ptr int64](unsafeAddr(arr))
let ret = API.propSetIntArray(vsmap, key.cstring, p, arr.len.cint)
if ret == 1:
raise newException(ValueError, "Size is negative")
This is not working. I am getting (probably the addresses):
integers: @[94379288560544, 94379288560512, 94379297070336]
instead of:
integers: @[1, 3, 5]