tinygo/testdata/cgo/main.c
Ayke 01f6aff422 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.
2019-02-08 13:04:03 +01:00

11 строки
109 Б
C

#include "main.h"
int global = 3;
int fortytwo() {
return 42;
}
int add(int a, int b) {
return a + b;
}