-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making the module both TinyGo and Go friendly for compilation/testing…
…. Tweaking registration functions. (#3) Co-authored-by: Phil Kedy <[email protected]>
- Loading branch information
Showing
6 changed files
with
81 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/wapc/wapc-guest-tinygo | ||
|
||
go 1.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// +build !purego,!appengine,!wasm | ||
|
||
package wapc | ||
|
||
func guestRequest(operationPtr uintptr, payloadPtr uintptr) {} | ||
|
||
func guestResponse(ptr uintptr, len uint32) {} | ||
|
||
func guestError(ptr uintptr, len uint32) {} | ||
|
||
func hostCall( | ||
bindingPtr uintptr, bindingLen uint32, | ||
namespacePtr uintptr, namespaceLen uint32, | ||
operationPtr uintptr, operationLen uint32, | ||
payloadPtr uintptr, payloadLen uint32) bool { | ||
return true | ||
} | ||
|
||
func hostResponseLen() uint32 { return 0 } | ||
|
||
func hostResponse(ptr uintptr) {} | ||
|
||
func hostErrorLen() uint32 { return 0 } | ||
|
||
func hostError(ptr uintptr) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// +build wasm | ||
|
||
package wapc | ||
|
||
//go:wasm-module wapc | ||
//go:export __guest_request | ||
func guestRequest(operationPtr uintptr, payloadPtr uintptr) | ||
|
||
//go:wasm-module wapc | ||
//go:export __guest_response | ||
func guestResponse(ptr uintptr, len uint32) | ||
|
||
//go:wasm-module wapc | ||
//go:export __guest_error | ||
func guestError(ptr uintptr, len uint32) | ||
|
||
//go:wasm-module wapc | ||
//go:export __host_call | ||
func hostCall( | ||
bindingPtr uintptr, bindingLen uint32, | ||
namespacePtr uintptr, namespaceLen uint32, | ||
operationPtr uintptr, operationLen uint32, | ||
payloadPtr uintptr, payloadLen uint32) bool | ||
|
||
//go:wasm-module wapc | ||
//go:export __host_response_len | ||
func hostResponseLen() uint32 | ||
|
||
//go:wasm-module wapc | ||
//go:export __host_response | ||
func hostResponse(ptr uintptr) | ||
|
||
//go:wasm-module wapc | ||
//go:export __host_error_len | ||
func hostErrorLen() uint32 | ||
|
||
//go:wasm-module wapc | ||
//go:export __host_error | ||
func hostError(ptr uintptr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters