texportc.nim 356 B

1234567891011121314151617181920212223
  1. discard """
  2. targets: "c cpp"
  3. """
  4. var fun0 {.importc.}: int
  5. proc fun1() {.importc.}
  6. proc fun2() {.importc: "$1".}
  7. proc fun3() {.importc: "fun3Bis".}
  8. when defined cpp:
  9. # proc funx1() {.importcpp.} # this does not work yet
  10. proc funx1() {.importc: "_Z5funx1v".}
  11. doAssert fun0 == 10
  12. fun1()
  13. fun2()
  14. fun3()
  15. when defined cpp:
  16. funx1()
  17. import ./mexportc