v2 / vlib / v / tests / project_with_c_code / mod1 / wrapper.c.v
17 lines · 12 sloc · 275 bytes · a87a4d73b9ab25cfff0822f4e94cf2a2d9e64323
Raw
1module mod1
2
3#flag -I @VMODROOT/mod1/c
4#flag @VMODROOT/mod1/c/implementation.o
5
6#include "header.h"
7
8pub struct C.MyStruct {
9 UppercaseField int
10}
11
12fn C.cadd(i32, i32) i32
13
14pub fn vadd(a int, b int) int {
15 x := C.MyStruct{100}
16 return 900 + x.UppercaseField + C.cadd(a, b)
17}
18