cgo: full test

cgo: test returning void
This commit is contained in:
Li Jie
2024-11-26 11:23:46 +08:00
parent 39dc68fa4e
commit c9f436cc47
9 changed files with 207 additions and 0 deletions

16
cl/_testgo/cgofull/foo.go Normal file
View File

@@ -0,0 +1,16 @@
package main
/*
#cgo CFLAGS: -DFOO
#include <stdio.h>
#include "foo.h"
static void foo(Foo* f) {
printf("foo in bar: %d\n", f->a);
}
*/
import "C"
func Foo(f *C.Foo) {
C.print_foo(f)
C.foo(f)
}