cl: instr llgo.index/advance

This commit is contained in:
xushiwei
2024-05-07 16:05:18 +08:00
parent 942b1f5159
commit 5a5d86ccc3
7 changed files with 84 additions and 6 deletions

2
c/c.go
View File

@@ -41,7 +41,7 @@ type integer interface {
func Str(string) *Char
//go:linkname Advance llgo.advance
func Advance(ptr Pointer, offset int) Pointer
func Advance[PtrT any](ptr PtrT, offset int) PtrT { return ptr }
// llgo:link Index llgo.index
func Index[T any, I integer](ptr *T, offset I) T { return *ptr }