loader: support global variables in CGo (#173)

Global variables (like functions) must be declared in the import "C" preamble and can then be used from Go.
This commit is contained in:
Ayke
2019-02-08 13:04:03 +01:00
committed by Ron Evans
parent 7dd5839f47
commit 01f6aff422
8 changed files with 92 additions and 34 deletions
+1
View File
@@ -16,4 +16,5 @@ func main() {
println("myint size:", int(unsafe.Sizeof(x)))
var y C.longlong = -(1 << 40)
println("longlong:", y)
println("global:", C.global)
}