Skip to content

Commit

Permalink
Merge pull request #7 from dgryski/ydnar/wasip2
Browse files Browse the repository at this point in the history
all: use generated Go bindings
  • Loading branch information
dgryski authored Feb 22, 2024
2 parents 8731bd0 + 87150c6 commit 401d1f1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/runtime/runtime_tinygowasmp2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/ydnar/wasm-tools-go/cm"
"github.com/ydnar/wasm-tools-go/wasi/cli/exit"
"github.com/ydnar/wasm-tools-go/wasi/cli/stdout"
"github.com/ydnar/wasm-tools-go/wasi/clocks/monotonicclock"
"github.com/ydnar/wasm-tools-go/wasi/clocks/wallclock"
monotonicclock "github.com/ydnar/wasm-tools-go/wasi/clocks/monotonic-clock"
wallclock "github.com/ydnar/wasm-tools-go/wasi/clocks/wall-clock"
"github.com/ydnar/wasm-tools-go/wasi/random/random"
)

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/runtime_wasm_wasip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"unsafe"

"github.com/ydnar/wasm-tools-go/wasi/cli/environment"
"github.com/ydnar/wasm-tools-go/wasi/clocks/monotonicclock"
"github.com/ydnar/wasm-tools-go/wasi/clocks/wallclock"
monotonicclock "github.com/ydnar/wasm-tools-go/wasi/clocks/monotonic-clock"
wallclock "github.com/ydnar/wasm-tools-go/wasi/clocks/wall-clock"
)

type timeUnit int64
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/env_wasip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func Environ() []string {
var env []string
for _, kv := range environment.GetEnvironment().Slice() {
env = append(env, kv.V0+"="+kv.V1)
env = append(env, kv[0]+"="+kv[1])
}
return env
}
7 changes: 4 additions & 3 deletions src/syscall/libc_wasip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"github.com/ydnar/wasm-tools-go/wasi/cli/stderr"
"github.com/ydnar/wasm-tools-go/wasi/cli/stdin"
"github.com/ydnar/wasm-tools-go/wasi/cli/stdout"
"github.com/ydnar/wasm-tools-go/wasi/clocks/wallclock"
wallclock "github.com/ydnar/wasm-tools-go/wasi/clocks/wall-clock"
"github.com/ydnar/wasm-tools-go/wasi/filesystem/preopens"
"github.com/ydnar/wasm-tools-go/wasi/filesystem/types"
ioerror "github.com/ydnar/wasm-tools-go/wasi/io/error"
"github.com/ydnar/wasm-tools-go/wasi/io/streams"
)

Expand Down Expand Up @@ -121,7 +122,7 @@ func findFreeFD() int32 {
return newfd
}

var wasiErrno error
var wasiErrno ioerror.Error

type wasiStream struct {
in *streams.InputStream
Expand Down Expand Up @@ -696,7 +697,7 @@ func errorCodeToErrno(err types.ErrorCode) Errno {
return EINTR
case types.ErrorCodeInvalid:
return EINVAL
case types.ErrorCodeIo:
case types.ErrorCodeIO:
return EIO
case types.ErrorCodeIsDirectory:
return EISDIR
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/github.com/ydnar/wasm-tools-go
Submodule wasm-tools-go updated 102 files

0 comments on commit 401d1f1

Please sign in to comment.