mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
runtime: implement math/rand.fastrand64 to fix linker error
This is needed for Go 1.20 support.
This commit is contained in:
committed by
Ron Evans
parent
c43958972c
commit
d639e01650
@@ -7,6 +7,14 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// This function is needed by math/rand since Go 1.20.
|
||||||
|
// See: https://github.com/golang/go/issues/54880
|
||||||
|
//
|
||||||
|
//go:linkname rand_fastrand64 math/rand.fastrand64
|
||||||
|
func rand_fastrand64() uint64 {
|
||||||
|
return fastrand64()
|
||||||
|
}
|
||||||
|
|
||||||
// This function is used by hash/maphash.
|
// This function is used by hash/maphash.
|
||||||
func fastrand() uint32 {
|
func fastrand() uint32 {
|
||||||
xorshift32State = xorshift32(xorshift32State)
|
xorshift32State = xorshift32(xorshift32State)
|
||||||
|
|||||||
Reference in New Issue
Block a user