1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

dl: add a complete tested shared library generation/usage example

This commit is contained in:
Delyan Angelov
2020-12-15 18:22:07 +02:00
parent e3a1756b11
commit 3a9034a0d0
6 changed files with 105 additions and 23 deletions

10
vlib/dl/example/library.v Normal file
View File

@ -0,0 +1,10 @@
module library
[export: 'add_1']
pub fn add_1(x int, y int) int {
return my_private_function(x + y)
}
fn my_private_function(x int) int {
return 1 + x
}