diff --git a/crates/wasi/src/lib.rs b/crates/wasi/src/lib.rs index d4a6e3a0d1..f281b84e2a 100644 --- a/crates/wasi/src/lib.rs +++ b/crates/wasi/src/lib.rs @@ -6,10 +6,15 @@ pub use wasi_common::{WasiCtx, WasiCtxBuilder}; // Defines a `struct Wasi` with member fields and appropriate APIs for dealing // with all the various WASI exports. -wasmtime_wiggle::define_struct_for_wiggle!({ +wasmtime_wiggle::define_wasmtime_integration!({ + // The wiggle code to integrate with lives here: target: wasi_common::wasi, + // This must be the same witx document as used above: witx: ["../wasi-common/WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx"], + // This must be the same ctx type as used for the target: ctx: WasiCtx, + // This macro will emit a struct to represent the instance, + // with this name and docs: instance: { name: Wasi, docs: "An instantiated instance of the wasi exports. diff --git a/crates/wiggle/wasmtime/macro/src/lib.rs b/crates/wiggle/wasmtime/macro/src/lib.rs index 7b520836dc..ebfc0bb98c 100644 --- a/crates/wiggle/wasmtime/macro/src/lib.rs +++ b/crates/wiggle/wasmtime/macro/src/lib.rs @@ -9,7 +9,7 @@ mod config; use config::{InstanceConf, TargetConf}; #[proc_macro] -pub fn define_struct_for_wiggle(args: TokenStream) -> TokenStream { +pub fn define_wasmtime_integration(args: TokenStream) -> TokenStream { let mut config = parse_macro_input!(args as config::Config); config.witx.make_paths_relative_to( std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR env var"),