diff --git a/Cargo.toml b/Cargo.toml index 14c990d..461c72d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ all-features = true [features] default = ["backtrace", "safe-shared-libraries"] -test-support = ["ctor"] +test-support = ["small_ctor"] json = ["serde_json"] safe-shared-libraries = ["findshlibs"] @@ -30,9 +30,9 @@ ipc-channel = "0.18.2" serde = { version = "1.0.104", features = ["derive"] } backtrace = { version = "0.3.43", optional = true, features = ["serde"] } libc = "0.2.66" -ctor = { version = "0.1.20", optional = true } serde_json = { version = "1.0.47", optional = true } findshlibs = { version = "0.10.2", optional = true } +small_ctor = { version = "0.1.2", optional = true } [target."cfg(windows)".dependencies] winapi = { version = "0.3.9", features = [ diff --git a/src/testsupport.rs b/src/testsupport.rs index 4cd25f5..570fd15 100644 --- a/src/testsupport.rs +++ b/src/testsupport.rs @@ -9,7 +9,7 @@ static TEST_MODE: AtomicBool = AtomicBool::new(false); static TEST_MODULE: AtomicPtr = AtomicPtr::new(std::ptr::null_mut()); // we need this. -pub use ctor::ctor; +pub use small_ctor::ctor; /// Supports the use of procspawn in tests. /// @@ -26,7 +26,7 @@ pub use ctor::ctor; macro_rules! enable_test_support { () => { #[$crate::testsupport::ctor] - fn __procspawn_test_support_init() { + unsafe fn __procspawn_test_support_init() { // strip the crate name from the module path let module_path = std::module_path!().splitn(2, "::").nth(1); $crate::testsupport::enable(module_path);