Skip to content

Commit

Permalink
Merge branch 'master' into feat/mac-native
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiwalun committed Jul 23, 2023
2 parents 377c560 + e42010f commit 92835c2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hidapi"
version = "2.4.0"
version = "2.4.1"
authors = [
"Roland Ruckerbauer <roland.rucky@gmail.com>",
"Osspial <osspial@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl From<std::io::Error> for HidError {
}
}

#[cfg(feature = "linux-native")]
#[cfg(all(feature = "linux-native", target_os = "linux"))]
impl From<nix::errno::Errno> for HidError {
fn from(e: nix::errno::Errno) -> Self {
Self::IoError { error: e.into() }
Expand Down
13 changes: 8 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
//! an opt-in that can be enabled with the `macos-shared-device` feature flag.

extern crate libc;
#[cfg(feature = "linux-native")]
#[cfg(all(feature = "linux-native", target_os = "linux"))]
extern crate nix;

#[cfg(target_os = "windows")]
Expand All @@ -72,8 +72,8 @@ mod ffi;
#[cfg(hidapi)]
mod hidapi;

#[cfg(feature = "linux-native")]
#[cfg_attr(docsrs, doc(cfg(feature = "linux-native")))]
#[cfg(all(feature = "linux-native", target_os = "linux"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "linux-native", target_os = "linux"))))]
mod linux_native;
#[cfg(all(target_os = "macos", hidapi))]
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
Expand All @@ -95,7 +95,7 @@ pub use error::HidError;

#[cfg(hidapi)]
use crate::hidapi::HidApiBackend;
#[cfg(feature = "linux-native")]
#[cfg(all(feature = "linux-native", target_os = "linux"))]
use linux_native::HidApiBackend;
#[cfg(feature = "macos-native")]
use macos_native::HidApiBackend;
Expand Down Expand Up @@ -266,7 +266,10 @@ impl HidApi {
enum WcharString {
String(String),
#[cfg_attr(
any(feature = "linux-native", feature = "macos-native"),
any(
all(feature = "linux-native", target_os = "linux"),
all(feature = "macos-native", target_os = "macos")
),
allow(dead_code)
)]
Raw(Vec<wchar_t>),
Expand Down

0 comments on commit 92835c2

Please sign in to comment.