1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 00:10:24 +08:00

feat(example): impl. vadd

This commit is contained in:
源文雨
2026-03-25 00:25:24 +08:00
parent 1111b0ecc1
commit 25cb3b9741
16 changed files with 531 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"math"
"reflect"
"strconv"
)
type ReturnTypes interface {
@@ -18,8 +19,8 @@ type ReturnTypes interface {
//go:uintptrescapes
func Call[T ReturnTypes](name string, args ...uintptr) (r T, err error) {
r1, r2, err := Syscall(name, args...)
if err != nil {
return
if r1 != 0 {
err = errors.New("zecall " + name + ": non-zero return value 0x" + strconv.FormatUint(uint64(r1), 16))
}
k := reflect.TypeOf(r).Kind()
switch k {