blob: b13fe1cafc18d3e956bf08720b06edef8562ec5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import shared
echo "Calling shared lib mulTwo(10): ", mulTwo(10)
echo "Calling shared lib countWords('hello, world, hello'): ", countWords("hello, world, hello")
echo "Calling shared lib getMsg('test'): ", getMsg()
{.emit: """
#include <test_header.h>
""".}
var testHeaderVal {.importc: "TEST_HEADER_VAL", nodecl.}: cint
echo "TEST_HEADER_VAL: ", testHeaderVal
proc test_add_five(x: cint): cint {.importc: "test_add_five", nodecl.}
echo "test_add_five(80): ", test_add_five(80)
|