mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 21:43:40 +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
+2
@@ -1,5 +1,7 @@
|
||||
#include "main.h"
|
||||
|
||||
int global = 3;
|
||||
|
||||
int fortytwo() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user