diff --git a/Cargo.toml b/Cargo.toml index d44dcea..74c6776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ecu_diagnostics" -version = "0.95.4" +version = "0.95.5" authors = ["Ashcon Mohseninia "] edition = "2021" description = "A rust crate for ECU diagnostic servers and communication APIs" diff --git a/src/channel.rs b/src/channel.rs index 20cb3d8..4035cde 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -9,7 +9,7 @@ use std::{ sync::{mpsc, Arc, Mutex, PoisonError}, }; -#[cfg(feature="socketcan")] +#[cfg(all(feature="socketcan", target_os="linux"))] use socketcan::{EmbeddedFrame, Id, ExtendedId, StandardId, CanDataFrame}; use crate::hardware::HardwareError; @@ -448,7 +448,7 @@ impl Packet for CanFrame { } } -#[cfg(feature="socketcan")] +#[cfg(all(feature="socketcan", target_os="linux"))] impl From for CanFrame { fn from(value: CanDataFrame) -> Self { let (id, ext) = match value.id() { @@ -459,7 +459,7 @@ impl From for CanFrame { } } -#[cfg(feature="socketcan")] +#[cfg(all(feature="socketcan", target_os="linux"))] impl Into for CanFrame { fn into(self) -> CanDataFrame { let id = match self.ext { diff --git a/src/hardware/mod.rs b/src/hardware/mod.rs index 5601ce9..5293f1f 100644 --- a/src/hardware/mod.rs +++ b/src/hardware/mod.rs @@ -10,7 +10,7 @@ pub mod passthru; // Not finished at all yet, hide from the crate #[cfg(feature = "passthru")] use std::sync::Arc; -#[cfg(all(feature = "socketcan", unix))] +#[cfg(all(feature="socketcan", target_os="linux"))] pub mod socketcan; use crate::channel::{CanChannel, IsoTPChannel};