From aa06b06b9f1b7ef5dc5300f3ebcc12f742014c30 Mon Sep 17 00:00:00 2001 From: Ashcon Mohseninia Date: Sun, 24 Dec 2023 19:21:59 +0100 Subject: [PATCH] 0.95.5 - Fix Win32 compile --- Cargo.toml | 2 +- src/channel.rs | 6 +++--- src/hardware/mod.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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};