mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
wasi preview 2 support (#4027)
* all: wasip2 support Co-authored-by: Randy Reddig <randy.reddig@fastly.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
// This file exists for testing this package without WebAssembly,
|
||||
// allowing empty function bodies with a //go:wasmimport directive.
|
||||
// See https://pkg.go.dev/cmd/compile for more information.
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by wit-bindgen-go. DO NOT EDIT.
|
||||
|
||||
//go:build !wasip1
|
||||
|
||||
// Package preopens represents the imported interface "wasi:filesystem/preopens@0.2.0".
|
||||
package preopens
|
||||
|
||||
import (
|
||||
"github.com/ydnar/wasm-tools-go/cm"
|
||||
"internal/wasi/filesystem/v0.2.0/types"
|
||||
)
|
||||
|
||||
// GetDirectories represents the imported function "get-directories".
|
||||
//
|
||||
// Return the set of preopened directories, and their path.
|
||||
//
|
||||
// get-directories: func() -> list<tuple<descriptor, string>>
|
||||
//
|
||||
//go:nosplit
|
||||
func GetDirectories() (result cm.List[cm.Tuple[types.Descriptor, string]]) {
|
||||
wasmimport_GetDirectories(&result)
|
||||
return
|
||||
}
|
||||
|
||||
//go:wasmimport wasi:filesystem/preopens@0.2.0 get-directories
|
||||
//go:noescape
|
||||
func wasmimport_GetDirectories(result *cm.List[cm.Tuple[types.Descriptor, string]])
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by wit-bindgen-go. DO NOT EDIT.
|
||||
|
||||
//go:build !wasip1
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"github.com/ydnar/wasm-tools-go/cm"
|
||||
wallclock "internal/wasi/clocks/v0.2.0/wall-clock"
|
||||
)
|
||||
|
||||
func lower_DateTime(v wallclock.DateTime) (f0 uint64, f1 uint32) {
|
||||
f0 = (uint64)(v.Seconds)
|
||||
f1 = (uint32)(v.Nanoseconds)
|
||||
return
|
||||
}
|
||||
|
||||
func lower_NewTimestamp(v NewTimestamp) (f0 uint32, f1 uint64, f2 uint32) {
|
||||
f0 = (uint32)(cm.Tag(&v))
|
||||
switch f0 {
|
||||
case 2: // timestamp
|
||||
v1, v2 := lower_DateTime(*v.Timestamp())
|
||||
f1 = (uint64)(v1)
|
||||
f2 = (uint32)(v2)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// This file exists for testing this package without WebAssembly,
|
||||
// allowing empty function bodies with a //go:wasmimport directive.
|
||||
// See https://pkg.go.dev/cmd/compile for more information.
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user