Upgrade to witx 0.8.0 with tagged unions (#921)

* witx tagged unions: updates to wig to use new semantics

* wig: emit a `#variant: ()` union variant for empty variants

* wasi-common: translate to use tagged unions

* update to flattened layout of event struct

* wig: generate layout tests, and delete bindgen ones

the bindgen tests became out-of-date with the latest changes to the
representation of unions, and the re-jiggering of various struct
definitions that went along with it.

* wasi: point at master with tagged union PR merged

* fix event struct repr on windows
This commit is contained in:
Pat Hickey
2020-02-20 07:52:03 -08:00
committed by GitHub
parent 80b095f2e2
commit 4460e569cf
19 changed files with 270 additions and 2170 deletions

View File

@@ -175,9 +175,7 @@ fn make_rw_event(event: &FdEventData, nbytes: Result<u64>) -> wasi::__wasi_event
userdata: event.userdata,
r#type: event.r#type,
error: error.as_raw_errno(),
u: wasi::__wasi_event_u_t {
fd_readwrite: wasi::__wasi_event_fd_readwrite_t { nbytes, flags: 0 },
},
fd_readwrite: wasi::__wasi_event_fd_readwrite_t { nbytes, flags: 0 },
}
}
@@ -186,11 +184,9 @@ fn make_timeout_event(timeout: &ClockEventData) -> wasi::__wasi_event_t {
userdata: timeout.userdata,
r#type: wasi::__WASI_EVENTTYPE_CLOCK,
error: wasi::__WASI_ERRNO_SUCCESS,
u: wasi::__wasi_event_u_t {
fd_readwrite: wasi::__wasi_event_fd_readwrite_t {
nbytes: 0,
flags: 0,
},
fd_readwrite: wasi::__wasi_event_fd_readwrite_t {
nbytes: 0,
flags: 0,
},
}
}