@@ -159,7 +159,7 @@ impl TryToTokens for ast::Program {
159
159
let prefix_json_bytes = syn:: LitByteStr :: new ( & prefix_json_bytes, Span :: call_site ( ) ) ;
160
160
161
161
( quote ! {
162
- #[ cfg( target_arch = "wasm32" ) ]
162
+ #[ cfg( all ( target_arch = "wasm32" , target_os = "unknown" ) ) ]
163
163
#[ automatically_derived]
164
164
const _: ( ) = {
165
165
use #wasm_bindgen:: __rt:: { flat_len, flat_byte_slices} ;
@@ -268,12 +268,12 @@ impl ToTokens for ast::Struct {
268
268
let ptr = #wasm_bindgen:: convert:: IntoWasmAbi :: into_abi( value) ;
269
269
270
270
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
271
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
271
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
272
272
extern "C" {
273
273
fn #new_fn( ptr: u32 ) -> u32 ;
274
274
}
275
275
276
- #[ cfg( not( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
276
+ #[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
277
277
unsafe fn #new_fn( _: u32 ) -> u32 {
278
278
panic!( "cannot convert to JsValue outside of the wasm target" )
279
279
}
@@ -285,7 +285,7 @@ impl ToTokens for ast::Struct {
285
285
}
286
286
}
287
287
288
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
288
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
289
289
#[ automatically_derived]
290
290
const _: ( ) = {
291
291
#[ no_mangle]
@@ -373,12 +373,12 @@ impl ToTokens for ast::Struct {
373
373
let idx = #wasm_bindgen:: convert:: IntoWasmAbi :: into_abi( & value) ;
374
374
375
375
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
376
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
376
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
377
377
extern "C" {
378
378
fn #unwrap_fn( ptr: u32 ) -> u32 ;
379
379
}
380
380
381
- #[ cfg( not( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
381
+ #[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
382
382
unsafe fn #unwrap_fn( _: u32 ) -> u32 {
383
383
panic!( "cannot convert from JsValue outside of the wasm target" )
384
384
}
@@ -481,7 +481,7 @@ impl ToTokens for ast::StructField {
481
481
( quote ! {
482
482
#[ automatically_derived]
483
483
const _: ( ) = {
484
- #[ cfg_attr( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) , no_mangle) ]
484
+ #[ cfg_attr( all( target_arch = "wasm32" , target_os = "unknown" ) , no_mangle) ]
485
485
#[ doc( hidden) ]
486
486
pub unsafe extern "C" fn #getter( js: u32 )
487
487
-> #wasm_bindgen:: convert:: WasmRet <<#ty as #wasm_bindgen:: convert:: IntoWasmAbi >:: Abi >
@@ -519,7 +519,7 @@ impl ToTokens for ast::StructField {
519
519
let ( args, names) = splat ( wasm_bindgen, & Ident :: new ( "val" , rust_name. span ( ) ) , & abi) ;
520
520
521
521
( quote ! {
522
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
522
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
523
523
#[ automatically_derived]
524
524
const _: ( ) = {
525
525
#[ no_mangle]
@@ -777,7 +777,7 @@ impl TryToTokens for ast::Export {
777
777
const _: ( ) = {
778
778
#( #attrs) *
779
779
#[ cfg_attr(
780
- all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ,
780
+ all( target_arch = "wasm32" , target_os = "unknown" ) ,
781
781
export_name = #export_name,
782
782
) ]
783
783
pub unsafe extern "C" fn #generated_name( #( #args) , * ) -> #wasm_bindgen:: convert:: WasmRet <#projection:: Abi > {
@@ -1036,11 +1036,11 @@ impl ToTokens for ast::ImportType {
1036
1036
impl JsCast for #rust_name {
1037
1037
fn instanceof( val: & JsValue ) -> bool {
1038
1038
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
1039
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1039
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
1040
1040
extern "C" {
1041
1041
fn #instanceof_shim( val: u32 ) -> u32 ;
1042
1042
}
1043
- #[ cfg( not( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
1043
+ #[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
1044
1044
unsafe fn #instanceof_shim( _: u32 ) -> u32 {
1045
1045
panic!( "cannot check instanceof on non-wasm targets" ) ;
1046
1046
}
@@ -1655,12 +1655,12 @@ impl ToTokens for ast::ImportStatic {
1655
1655
#vis static #name: #wasm_bindgen:: JsStatic <#ty> = {
1656
1656
fn init( ) -> #ty {
1657
1657
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
1658
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1658
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
1659
1659
extern "C" {
1660
1660
fn #shim_name( ) -> #abi_ret;
1661
1661
}
1662
1662
1663
- #[ cfg( not( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
1663
+ #[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
1664
1664
unsafe fn #shim_name( ) -> #abi_ret {
1665
1665
panic!( "cannot access imported statics on non-wasm targets" )
1666
1666
}
@@ -1725,7 +1725,7 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
1725
1725
let attrs = & self . attrs ;
1726
1726
let wasm_bindgen = & self . wasm_bindgen ;
1727
1727
( quote ! {
1728
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1728
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
1729
1729
#[ automatically_derived]
1730
1730
const _: ( ) = {
1731
1731
#( #attrs) *
@@ -1751,14 +1751,14 @@ fn extern_fn(
1751
1751
abi_ret : TokenStream ,
1752
1752
) -> TokenStream {
1753
1753
quote ! {
1754
- #[ cfg( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ]
1754
+ #[ cfg( all( target_arch = "wasm32" , target_os = "unknown" ) ) ]
1755
1755
#( #attrs) *
1756
1756
#[ link( wasm_import_module = "__wbindgen_placeholder__" ) ]
1757
1757
extern "C" {
1758
1758
fn #import_name( #( #abi_arguments) , * ) -> #abi_ret;
1759
1759
}
1760
1760
1761
- #[ cfg( not( all( target_arch = "wasm32" , not ( any ( target_os = "emscripten" , target_os = "wasi" ) ) ) ) ) ]
1761
+ #[ cfg( not( all( target_arch = "wasm32" , target_os = "unknown" ) ) ) ]
1762
1762
unsafe fn #import_name( #( #abi_arguments) , * ) -> #abi_ret {
1763
1763
#(
1764
1764
drop( #abi_argument_names) ;
0 commit comments