summary refs log tree commit diff stats
path: root/tests/cpp/texportc.nim
blob: 3a2fa8748f0fe774f6d54a74aac0638d6e7c7fa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
discard """
  targets: "c cpp"
"""

var fun0 {.importc.}: int
proc fun1() {.importc.}
proc fun2() {.importc: "$1".}
proc fun3() {.importc: "fun3Bis".}

when defined cpp:
  # proc funx1() {.importcpp.} # this does not work yet
  proc funx1() {.importc: "_Z5funx1v".}

doAssert fun0 == 10
fun1()
fun2()
fun3()

when defined cpp:
  funx1()

import ./mexportc