From cec062bd4b2428b33d5e0fdde607438ca246e771 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 6 Nov 2023 10:59:28 +0800 Subject: [PATCH] fix(napi-sys): missing napi9 load on Windows (#1780) --- crates/sys/src/functions.rs | 4 +++- crates/sys/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/sys/src/functions.rs b/crates/sys/src/functions.rs index 28678466..91fa2410 100644 --- a/crates/sys/src/functions.rs +++ b/crates/sys/src/functions.rs @@ -761,7 +761,7 @@ pub use napi8::*; pub use napi9::*; #[cfg(windows)] -pub(super) unsafe fn load() -> Result { +pub(super) unsafe fn load_all() -> Result { let host = match libloading::os::windows::Library::this() { Ok(lib) => lib.into(), Err(err) => { @@ -785,6 +785,8 @@ pub(super) unsafe fn load() -> Result { napi7::load(&host)?; #[cfg(feature = "napi8")] napi8::load(&host)?; + #[cfg(feature = "napi9")] + napi9::load(&host)?; #[cfg(feature = "experimental")] experimental::load(&host)?; Ok(host) diff --git a/crates/sys/src/lib.rs b/crates/sys/src/lib.rs index 5cf4fa5b..9a29ae3e 100644 --- a/crates/sys/src/lib.rs +++ b/crates/sys/src/lib.rs @@ -90,7 +90,7 @@ pub use types::*; #[cfg(windows)] #[allow(clippy::missing_safety_doc)] pub unsafe fn setup() -> libloading::Library { - match load() { + match load_all() { Err(err) => panic!("{}", err), Ok(l) => l, }