From f8c06ece8755d61c6a7d6701aa252b5062c576fd Mon Sep 17 00:00:00 2001 From: Simon Struck Date: Mon, 8 Feb 2021 20:39:43 +0100 Subject: [PATCH] Fix mismatched types when compiling for arm --- src/raw.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/raw.rs b/src/raw.rs index e504205..e50fe3f 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -206,10 +206,22 @@ ioctl!(write_int eviocgrab with b'E', 0x90); ioctl!(write_int eviocrevoke with b'E', 0x91); ioctl!(write_int eviocsclockid with b'E', 0xa0); +#[cfg(target_arch = "arm")] +pub unsafe fn eviocgbit(fd: ::libc::c_int, ev: u32, len: ::libc::c_int, buf: *mut u8) -> ::nix::Result { + convert_ioctl_res!(::nix::libc::ioctl(fd, ior!(b'E', 0x20 + ev, len) as ::libc::c_long, buf)) +} + +#[cfg(not(target_arch = "arm"))] pub unsafe fn eviocgbit(fd: ::libc::c_int, ev: u32, len: ::libc::c_int, buf: *mut u8) -> ::nix::Result { convert_ioctl_res!(::nix::libc::ioctl(fd, ior!(b'E', 0x20 + ev, len) as ::libc::c_ulong, buf)) } +#[cfg(target_arch = "arm")] +pub unsafe fn eviocgabs(fd: ::libc::c_int, abs: u32, buf: *mut input_absinfo) -> ::nix::Result { + convert_ioctl_res!(::nix::libc::ioctl(fd, ior!(b'E', 0x40 + abs, ::std::mem::size_of::()) as ::libc::c_long, buf)) +} + +#[cfg(not(target_arch = "arm"))] pub unsafe fn eviocgabs(fd: ::libc::c_int, abs: u32, buf: *mut input_absinfo) -> ::nix::Result { convert_ioctl_res!(::nix::libc::ioctl(fd, ior!(b'E', 0x40 + abs, ::std::mem::size_of::()) as ::libc::c_ulong, buf)) }