make runtime compatible with wasm

This commit is contained in:
Li Jie
2025-04-08 16:50:47 +08:00
parent 7c81d9293b
commit be4737461a
183 changed files with 14122 additions and 647 deletions

View File

@@ -22,7 +22,7 @@ import (
"sync/atomic"
_ "unsafe" // for go:linkname
"github.com/goplus/llgo/runtime/internal/clite"
c "github.com/goplus/llgo/runtime/internal/clite"
"github.com/goplus/llgo/runtime/internal/clite/math/rand"
"github.com/goplus/llgo/runtime/internal/clite/time"
)
@@ -348,7 +348,7 @@ func fastrand64() uint64 {
}
func init() {
rand.Srandom(clite.Uint(time.Time(nil)))
rand.Srandom(c.Uint(time.Time(nil)))
}
// fastSource is an implementation of Source64 that uses the runtime