@@ -221,12 +221,12 @@ impl ToTokens for ast::Struct {
221
221
let ptr = #wasm_bindgen:: convert:: IntoWasmAbi :: into_abi( value) ;
222
222
223
223
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
224
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
224
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
225
225
extern "C" {
226
226
fn #new_fn( ptr: u32 ) -> u32 ;
227
227
}
228
228
229
- #[ cfg( not( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
229
+ #[ cfg( not( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
230
230
unsafe fn #new_fn( _: u32 ) -> u32 {
231
231
panic!( "cannot convert to JsValue outside of the wasm target" )
232
232
}
@@ -238,7 +238,7 @@ impl ToTokens for ast::Struct {
238
238
}
239
239
}
240
240
241
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
241
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
242
242
#[ automatically_derived]
243
243
const _: ( ) = {
244
244
#[ no_mangle]
@@ -327,7 +327,7 @@ impl ToTokens for ast::StructField {
327
327
( quote ! {
328
328
#[ automatically_derived]
329
329
const _: ( ) = {
330
- #[ cfg_attr( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) , no_mangle) ]
330
+ #[ cfg_attr( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) , no_mangle) ]
331
331
#[ doc( hidden) ]
332
332
pub unsafe extern "C" fn #getter( js: u32 )
333
333
-> <#ty as #wasm_bindgen:: convert:: IntoWasmAbi >:: Abi
@@ -362,7 +362,7 @@ impl ToTokens for ast::StructField {
362
362
}
363
363
364
364
( quote ! {
365
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
365
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
366
366
#[ automatically_derived]
367
367
const _: ( ) = {
368
368
#[ no_mangle]
@@ -590,7 +590,7 @@ impl TryToTokens for ast::Export {
590
590
const _: ( ) = {
591
591
#( #attrs) *
592
592
#[ cfg_attr(
593
- all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ,
593
+ all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ,
594
594
export_name = #export_name,
595
595
) ]
596
596
pub unsafe extern "C" fn #generated_name( #( #args) , * ) -> #projection:: Abi {
@@ -840,11 +840,11 @@ impl ToTokens for ast::ImportType {
840
840
impl JsCast for #rust_name {
841
841
fn instanceof( val: & JsValue ) -> bool {
842
842
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
843
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
843
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
844
844
extern "C" {
845
845
fn #instanceof_shim( val: u32 ) -> u32 ;
846
846
}
847
- #[ cfg( not( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
847
+ #[ cfg( not( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
848
848
unsafe fn #instanceof_shim( _: u32 ) -> u32 {
849
849
panic!( "cannot check instanceof on non-wasm targets" ) ;
850
850
}
@@ -1355,12 +1355,13 @@ impl ToTokens for ast::ImportStatic {
1355
1355
#vis static #name: #wasm_bindgen:: JsStatic <#ty> = {
1356
1356
fn init( ) -> #ty {
1357
1357
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
1358
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
1358
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1359
1359
extern "C" {
1360
1360
fn #shim_name( ) -> <#ty as #wasm_bindgen:: convert:: FromWasmAbi >:: Abi ;
1361
1361
}
1362
- #[ cfg( not( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
1363
- unsafe fn #shim_name( ) -> <#ty as #wasm_bindgen:: convert:: FromWasmAbi >:: Abi {
1362
+
1363
+ #[ cfg( not( all( target_arch = "wasm32" , not( any( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
1364
+ unsafe fn #shim_name( ) -> <#ty as wasm_bindgen:: convert:: FromWasmAbi >:: Abi {
1364
1365
panic!( "cannot access imported statics on non-wasm targets" )
1365
1366
}
1366
1367
@@ -1424,7 +1425,7 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
1424
1425
let attrs = & self . attrs ;
1425
1426
let wasm_bindgen = & self . wasm_bindgen ;
1426
1427
( quote ! {
1427
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
1428
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1428
1429
#[ automatically_derived]
1429
1430
const _: ( ) = {
1430
1431
#( #attrs) *
@@ -1450,14 +1451,14 @@ fn extern_fn(
1450
1451
abi_ret : TokenStream ,
1451
1452
) -> TokenStream {
1452
1453
quote ! {
1453
- #[ cfg( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ]
1454
+ #[ cfg( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1454
1455
#( #attrs) *
1455
1456
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
1456
1457
extern "C" {
1457
1458
fn #import_name( #( #abi_arguments) , * ) -> #abi_ret;
1458
1459
}
1459
1460
1460
- #[ cfg( not( all( target_arch = "wasm32" , not( target_os = "emscripten" ) ) ) ) ]
1461
+ #[ cfg( not( all( target_arch = "wasm32" , not( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
1461
1462
unsafe fn #import_name( #( #abi_arguments) , * ) -> #abi_ret {
1462
1463
#(
1463
1464
drop( #abi_argument_names) ;
0 commit comments