cl: c.Func (llgo.funcAddr); demo: cppintf (how to use c++ interface)

This commit is contained in:
xushiwei
2024-06-21 23:44:56 +08:00
parent be0ce57375
commit bfa4e08a4e
11 changed files with 149 additions and 35 deletions

3
c/c.go
View File

@@ -48,6 +48,9 @@ type integer interface {
//go:linkname Str llgo.cstr
func Str(string) *Char
//go:linkname Func llgo.funcAddr
func Func(any) Pointer
// llgo:link Advance llgo.advance
func Advance[PtrT any, I integer](ptr PtrT, offset I) PtrT { return ptr }