cgo: implement support for static functions

This commit is contained in:
Ayke van Laethem
2022-04-13 21:34:43 +02:00
committed by Ron Evans
parent 91104b2f27
commit 5551ec7a1e
10 changed files with 131 additions and 22 deletions
+3
View File
@@ -12,6 +12,7 @@ int mul(int, int);
import "C"
// int headerfunc(int a) { return a + 1; }
// static int headerfunc_static(int a) { return a - 1; }
import "C"
import "unsafe"
@@ -47,6 +48,8 @@ func main() {
// functions in the header C snippet
println("headerfunc:", C.headerfunc(5))
println("static headerfunc:", C.headerfunc_static(5))
headerfunc_2()
// equivalent types
var goInt8 int8 = 5