tinygo/testdata/cgo
Ayke van Laethem e02727679f builder, cgo: support function definitions in CGo headers
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.
2021-09-28 18:44:11 +02:00
..
extra.go cgo: refactor; support multiple cgo files in a single package 2019-05-12 10:49:15 +02:00
main.c cgo: add support for CFLAGS in .c files 2021-04-06 10:57:50 +02:00
main.go builder, cgo: support function definitions in CGo headers 2021-09-28 18:44:11 +02:00
main.h cgo: add support for CFLAGS in .c files 2021-04-06 10:57:50 +02:00
out.txt builder, cgo: support function definitions in CGo headers 2021-09-28 18:44:11 +02:00