nvro don't touch cdecl types [backport: 1.6] (#19461)

* nvro don't touch cdecl types; fix #19342 again
This commit is contained in:
flywind 2022-01-28 16:53:42 +08:00 • committed by GitHub
commit 0c3892c3c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 19 deletions

View file

@ -0,0 +1,18 @@
discard """
targets: "c cpp"
"""
{.compile: "m19342.c".}
# bug #19342
type
Node* {.byRef.} = object
data: array[25, cint]
proc myproc(name: cint): Node {.importc: "hello", cdecl.}
proc parse =
let node = myproc(10)
doAssert node.data[0] == 999
parse()