@@ -1,4 +1,4 @@
1-//! Loads the widget library's latest build into this process: libconveyor_widgets.so, next to
1+//! Loads the widget library's latest build into this process: libconveyor_widgets (.so or .dylib), next to
22 //! the binary. Old builds stay mapped, since their threads may still be winding down. A build
33 //! made against another build of this app waits for the app's own restart.
44 use crate::api::{Abouts, Kinds};
@@ -19,7 +19,7 @@ pub struct Loader {
1919 impl Loader {
2020 pub fn new() -> Self {
2121 let dir = std::env::current_exe().ok().and_then(|e| Some(e.parent()?.to_owned())).unwrap_or_default();
22- Loader { file: dir.join("libconveyor_widgets.so"), loaded: None, count: 0 }
22+ Loader { file: dir.join(format!("libconveyor_widgets.{}", std::env::consts::DLL_EXTENSION)), loaded: None, count: 0 }
2323 }
2424
2525 /// The widgets of a build not loaded yet, when there is one this app can run.
@@ -29,7 +29,7 @@ impl Loader {
2929 self.count += 1;
3030 // dlopen keys on the path: each build gets its own.
3131 let dir = std::env::var("XDG_RUNTIME_DIR").map_or(std::env::temp_dir(), PathBuf::from);
32- let copy = dir.join(format!("conveyor-widgets-{}-{}.so", std::process::id(), self.count));
32+ let copy = dir.join(format!("conveyor-widgets-{}-{}.{}", std::process::id(), self.count, std::env::consts::DLL_EXTENSION));
3333 std::fs::copy(&self.file, ©).ok()?;
3434 let loaded = unsafe { open(©) };
3535 let _ = std::fs::remove_file(©);