Skip to content

Commit f57b33b

Browse files
authored
Merge pull request #538 from berkowski/master
Fixes #532
2 parents cd7380e + 71f3c09 commit f57b33b

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/sys/event.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ pub struct KEvent {
2222
target_os = "dragonfly", target_os = "macos",
2323
target_os = "ios"))]
2424
type type_of_udata = *mut ::c_void;
25+
#[cfg(any(target_os = "openbsd", target_os = "freebsd",
26+
target_os = "dragonfly", target_os = "macos",
27+
target_os = "ios"))]
28+
type type_of_data = libc::intptr_t;
2529
#[cfg(any(target_os = "netbsd"))]
2630
type type_of_udata = intptr_t;
31+
#[cfg(any(target_os = "netbsd"))]
32+
type type_of_data = libc::int64_t;
2733

2834
#[cfg(not(target_os = "netbsd"))]
2935
type type_of_event_filter = i16;
@@ -58,9 +64,9 @@ pub enum EventFilter {
5864
}
5965

6066
#[cfg(target_os = "netbsd")]
61-
type type_of_event_filter = i32;
67+
type type_of_event_filter = libc::uint32_t;
6268
#[cfg(target_os = "netbsd")]
63-
#[repr(u32)]
69+
#[repr(i32)]
6470
#[derive(Clone, Copy, Debug, PartialEq)]
6571
pub enum EventFilter {
6672
EVFILT_READ = libc::EVFILT_READ,
@@ -216,7 +222,7 @@ impl KEvent {
216222
filter: filter as type_of_event_filter,
217223
flags: flags.bits(),
218224
fflags: fflags.bits(),
219-
data: data,
225+
data: data as type_of_data,
220226
udata: udata as type_of_udata
221227
} }
222228
}
@@ -238,7 +244,7 @@ impl KEvent {
238244
}
239245

240246
pub fn data(&self) -> intptr_t {
241-
self.kevent.data
247+
self.kevent.data as intptr_t
242248
}
243249

244250
pub fn udata(&self) -> intptr_t {

src/sys/termios.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mod ffi {
158158
B7200, B14400, B28800, B57600,
159159
B76800, B115200, B230400};
160160

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

164164
match s {
@@ -185,9 +185,9 @@ mod ffi {
185185
B76800 => BaudRate::B76800,
186186
B115200 => BaudRate::B115200,
187187
B230400 => BaudRate::B230400,
188-
#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
188+
#[cfg(target_os = "freebsd")]
189189
B460800 => BaudRate::B460800,
190-
#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
190+
#[cfg(target_os = "freebsd")]
191191
B921600 => BaudRate::B921600,
192192
b @ _ => unreachable!("Invalid baud constant: {}", b),
193193
}

0 commit comments

Comments
 (0)