mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
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:
Vendored
+1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user