rename macro. add comments to invocation.
This commit is contained in:
@@ -6,10 +6,15 @@ pub use wasi_common::{WasiCtx, WasiCtxBuilder};
|
|||||||
|
|
||||||
// Defines a `struct Wasi` with member fields and appropriate APIs for dealing
|
// Defines a `struct Wasi` with member fields and appropriate APIs for dealing
|
||||||
// with all the various WASI exports.
|
// 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,
|
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"],
|
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,
|
ctx: WasiCtx,
|
||||||
|
// This macro will emit a struct to represent the instance,
|
||||||
|
// with this name and docs:
|
||||||
instance: {
|
instance: {
|
||||||
name: Wasi,
|
name: Wasi,
|
||||||
docs: "An instantiated instance of the wasi exports.
|
docs: "An instantiated instance of the wasi exports.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ mod config;
|
|||||||
use config::{InstanceConf, TargetConf};
|
use config::{InstanceConf, TargetConf};
|
||||||
|
|
||||||
#[proc_macro]
|
#[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);
|
let mut config = parse_macro_input!(args as config::Config);
|
||||||
config.witx.make_paths_relative_to(
|
config.witx.make_paths_relative_to(
|
||||||
std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR env var"),
|
std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR env var"),
|
||||||
|
|||||||
Reference in New Issue
Block a user