cl: parser llgo:type C

This commit is contained in:
visualfc
2024-07-07 11:45:46 +08:00
parent 794df59265
commit 22a2cc564f
6 changed files with 821 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
package qsort
import (
_ "unsafe"
"github.com/goplus/llgo/c"
)
const (
LLGoPackage = "decl"
)
// llgo:type C
type Comp func(a, b c.Pointer) c.Int
//go:linkname Qsort C.qsort
func Qsort(base c.Pointer, count, elem uintptr, compar Comp)
//go:linkname Qsort2 C.qsort
func Qsort2(base c.Pointer, count, elem uintptr, compar func(a, b c.Pointer) c.Int)