Update Examples

This commit is contained in:
Arnaud Castellanos Galea 2020-10-05 10:23:43 +08:00
commit 4c880db828
2 changed files with 64 additions and 6 deletions

View file

@ -1,7 +1,10 @@
# Compile with: nim c --noMain --app:lib plugin.nim
proc hello(x: int) {.exportc.} =
proc hello(x: int32) {.cdecl, exportc, dynlib.} =
echo "Hello world, ", x
proc highFive(): int {.exportc.} =
proc highFive(): int32 {.cdecl, exportc, dynlib.} =
result = 5
echo "Here you go!"
proc helloFancy(f: proc (n: int32): int32 {.cdecl.}) {.exportc.} =
echo "Such fancyness, ", f(42)