t23796.nim 394 B

1234567891011121314151617181920212223242526
  1. discard """
  2. targets: "c cpp"
  3. """
  4. # bug #23796
  5. {.emit: """
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. void fooArr(float data[3]) {}
  10. void fooIntArr(int id, float data[3]) {}
  11. #ifdef __cplusplus
  12. }
  13. #endif
  14. """.}
  15. proc fooArr(data: var array[3, cfloat]) {.importc.}
  16. proc fooIntArr(id: cint, data: var array[3, cfloat]) {.importc, nodecl.}
  17. var arr = [cfloat 1, 2, 3]
  18. fooArr(arr)
  19. fooIntArr(1, arr)