mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 09:14:00 +00:00
fixes #23796
(cherry picked from commit 1dcc364cd2)
This commit is contained in:
committed by
narimiran
parent
02eb396f45
commit
1100f550dc
25
tests/ccgbugs/t23796.nim
Normal file
25
tests/ccgbugs/t23796.nim
Normal file
@@ -0,0 +1,25 @@
|
||||
discard """
|
||||
targets: "c cpp"
|
||||
"""
|
||||
|
||||
# bug #23796
|
||||
|
||||
{.emit: """
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void fooArr(float data[3]) {}
|
||||
void fooIntArr(int id, float data[3]) {}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
""".}
|
||||
|
||||
proc fooArr(data: var array[3, cfloat]) {.importc.}
|
||||
proc fooIntArr(id: cint, data: var array[3, cfloat]) {.importc, nodecl.}
|
||||
|
||||
var arr = [cfloat 1, 2, 3]
|
||||
fooArr(arr)
|
||||
fooIntArr(1, arr)
|
||||
Reference in New Issue
Block a user