Skip to content

Commit

Permalink
Merge pull request #538 from berkowski/master
Browse files Browse the repository at this point in the history
Fixes #532
  • Loading branch information
posborne authored Feb 27, 2017
2 parents cd7380e + 71f3c09 commit f57b33b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions src/sys/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ pub struct KEvent {
target_os = "dragonfly", target_os = "macos",
target_os = "ios"))]
type type_of_udata = *mut ::c_void;
#[cfg(any(target_os = "openbsd", target_os = "freebsd",
target_os = "dragonfly", target_os = "macos",
target_os = "ios"))]
type type_of_data = libc::intptr_t;
#[cfg(any(target_os = "netbsd"))]
type type_of_udata = intptr_t;
#[cfg(any(target_os = "netbsd"))]
type type_of_data = libc::int64_t;

#[cfg(not(target_os = "netbsd"))]
type type_of_event_filter = i16;
Expand Down Expand Up @@ -58,9 +64,9 @@ pub enum EventFilter {
}

#[cfg(target_os = "netbsd")]
type type_of_event_filter = i32;
type type_of_event_filter = libc::uint32_t;
#[cfg(target_os = "netbsd")]
#[repr(u32)]
#[repr(i32)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EventFilter {
EVFILT_READ = libc::EVFILT_READ,
Expand Down Expand Up @@ -216,7 +222,7 @@ impl KEvent {
filter: filter as type_of_event_filter,
flags: flags.bits(),
fflags: fflags.bits(),
data: data,
data: data as type_of_data,
udata: udata as type_of_udata
} }
}
Expand All @@ -238,7 +244,7 @@ impl KEvent {
}

pub fn data(&self) -> intptr_t {
self.kevent.data
self.kevent.data as intptr_t
}

pub fn udata(&self) -> intptr_t {
Expand Down
6 changes: 3 additions & 3 deletions src/sys/termios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod ffi {
B7200, B14400, B28800, B57600,
B76800, B115200, B230400};

#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
#[cfg(target_os = "freebsd")]
use libc::{B460800, B921600};

match s {
Expand All @@ -185,9 +185,9 @@ mod ffi {
B76800 => BaudRate::B76800,
B115200 => BaudRate::B115200,
B230400 => BaudRate::B230400,
#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
#[cfg(target_os = "freebsd")]
B460800 => BaudRate::B460800,
#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
#[cfg(target_os = "freebsd")]
B921600 => BaudRate::B921600,
b @ _ => unreachable!("Invalid baud constant: {}", b),
}
Expand Down

0 comments on commit f57b33b

Please sign in to comment.