Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cryptovec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ wasm-bindgen-test = "0.3.46"

[features]
ssh-encoding = ["dep:ssh-encoding"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("motor"))'] }
11 changes: 7 additions & 4 deletions cryptovec/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ mod windows;

#[cfg(not(windows))]
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_os = "motor"))]
mod unix;

#[cfg(target_arch = "wasm32")]
// Motor OS has no memory-locking API; it uses the wasm no-op implementation.
#[cfg(any(target_arch = "wasm32", target_os = "motor"))]
mod wasm;

// Re-export functions based on the platform
#[cfg(not(windows))]
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_os = "motor"))]
pub use unix::{mlock, munlock};
#[cfg(target_arch = "wasm32")]
#[cfg(any(target_arch = "wasm32", target_os = "motor"))]
pub use wasm::{mlock, munlock};
#[cfg(windows)]
pub use windows::{mlock, munlock};

#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(target_arch = "wasm32", target_os = "motor")))]
mod error {
use std::error::Error;
use std::fmt::Display;
Expand Down Expand Up @@ -56,5 +59,5 @@ mod error {
impl Error for MemoryLockError {}
}

#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(any(target_arch = "wasm32", target_os = "motor")))]
pub use error::MemoryLockError;
Loading