diff options
author | snek <the@snek.dev> | 2024-06-10 09:20:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 16:20:44 +0000 |
commit | e3b2ee183bc7497ec0432bc764678f5eda6495a7 (patch) | |
tree | 7a5fa0208ef56cb83fa6bae9bad0bc89334ed533 /cli/napi/sym/lib.rs | |
parent | 7c5dbd5d54770dba5e56442b633e9597403ef5da (diff) |
fix: Rewrite Node-API (#24101)
Phase 1 node-api rewrite
Diffstat (limited to 'cli/napi/sym/lib.rs')
-rw-r--r-- | cli/napi/sym/lib.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cli/napi/sym/lib.rs b/cli/napi/sym/lib.rs index 33f039b5f..e2826306b 100644 --- a/cli/napi/sym/lib.rs +++ b/cli/napi/sym/lib.rs @@ -20,17 +20,12 @@ pub fn napi_sym(_attr: TokenStream, item: TokenStream) -> TokenStream { let name = &func.sig.ident; assert!( exports.symbols.contains(&name.to_string()), - "tools/napi/sym/symbol_exports.json is out of sync!" + "cli/napi/sym/symbol_exports.json is out of sync!" ); - let block = &func.block; - let inputs = &func.sig.inputs; - let generics = &func.sig.generics; TokenStream::from(quote! { - // SAFETY: it's an NAPI function. - #[no_mangle] - pub unsafe extern "C" fn #name #generics (#inputs) -> napi_status { - #block - } + crate::napi_wrap! { + #func + } }) } |