Skip to content

Commit

Permalink
Fix the type of _RawOpcode on uclibc. (#828)
Browse files Browse the repository at this point in the history
Apply a patch from @spritetong to fix the type of `_RawOpcode` on uclibc.

Fixes #827.
  • Loading branch information
sunfishcode authored Sep 15, 2023
1 parent 93c9547 commit d3ae806
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/ioctl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,21 @@ pub type RawOpcode = _RawOpcode;
#[cfg(linux_raw)]
type _RawOpcode = c::c_uint;

// On libc Linux with GNU libc, this is an unsigned long.
#[cfg(all(not(linux_raw), target_os = "linux", target_env = "gnu"))]
// On libc Linux with GNU libc or uclibc, this is an unsigned long.
#[cfg(all(
not(linux_raw),
target_os = "linux",
any(target_env = "gnu", target_env = "uclibc")
))]
type _RawOpcode = c::c_ulong;

// Musl uses a c_int
#[cfg(all(not(linux_raw), target_os = "linux", not(target_env = "gnu")))]
#[cfg(all(
not(linux_raw),
target_os = "linux",
not(target_env = "gnu"),
not(target_env = "uclibc")
))]
type _RawOpcode = c::c_int;

// Android uses c_int
Expand Down

0 comments on commit d3ae806

Please sign in to comment.