build: separate compiler and libs
This commit is contained in:
18
compiler/cl/_testrt/callback/in.go
Normal file
18
compiler/cl/_testrt/callback/in.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/goplus/llgo/c"
|
||||
)
|
||||
|
||||
func callback(msg *c.Char, f func(*c.Char)) {
|
||||
f(msg)
|
||||
}
|
||||
|
||||
func print(msg *c.Char) {
|
||||
c.Printf(msg)
|
||||
}
|
||||
|
||||
func main() {
|
||||
callback(c.Str("Hello\n"), print)
|
||||
callback(c.Str("callback\n"), print)
|
||||
}
|
||||
Reference in New Issue
Block a user