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:
10
vlib/dl/example/library.v
Normal file
10
vlib/dl/example/library.v
Normal 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
|
||||
}
|
Reference in New Issue
Block a user