![]() For example, the following did not work before but does work with this change: // int add(int a, int b) { // return a + b; // } import "C" func main() { println("add:", C.add(3, 5)) } Even better, the functions in the header are compiled together with the rest of the Go code and so they can be optimized together! Currently, inlining is not yet allowed but const-propagation across functions works. This should be improved in the future. |
||
---|---|---|
.. | ||
testdata | ||
cgo.go | ||
cgo_test.go | ||
const.go | ||
const_test.go | ||
libclang.go | ||
libclang_config.go | ||
libclang_config_llvm10.go | ||
libclang_stubs.c | ||
security.go | ||
security_test.go | ||
sync.go |