Skip to content

Commit 23758e3

Browse files
committed
cryptovec: add Motor OS support
1 parent 4882af7 commit 23758e3

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

cryptovec/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ wasm-bindgen-test = "0.3.46"
2929

3030
[features]
3131
ssh-encoding = ["dep:ssh-encoding"]
32+
33+
[lints.rust]
34+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("motor"))'] }

cryptovec/src/platform/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ mod windows;
33

44
#[cfg(not(windows))]
55
#[cfg(not(target_arch = "wasm32"))]
6+
#[cfg(not(target_os = "motor"))]
67
mod unix;
78

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

1113
// Re-export functions based on the platform
1214
#[cfg(not(windows))]
1315
#[cfg(not(target_arch = "wasm32"))]
16+
#[cfg(not(target_os = "motor"))]
1417
pub use unix::{mlock, munlock};
15-
#[cfg(target_arch = "wasm32")]
18+
#[cfg(any(target_arch = "wasm32", target_os = "motor"))]
1619
pub use wasm::{mlock, munlock};
1720
#[cfg(windows)]
1821
pub use windows::{mlock, munlock};
1922

20-
#[cfg(not(target_arch = "wasm32"))]
23+
#[cfg(not(any(target_arch = "wasm32", target_os = "motor")))]
2124
mod error {
2225
use std::error::Error;
2326
use std::fmt::Display;
@@ -56,5 +59,5 @@ mod error {
5659
impl Error for MemoryLockError {}
5760
}
5861

59-
#[cfg(not(target_arch = "wasm32"))]
62+
#[cfg(not(any(target_arch = "wasm32", target_os = "motor")))]
6063
pub use error::MemoryLockError;

0 commit comments

Comments
 (0)