Skip to content

Commit 879cfe6

Browse files
committed
std::rt::uv::uvll: Fix uv_req_type on Win32
Also enables request_sanity_check() test. Closes #8817
1 parent f3c8882 commit 879cfe6

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/libstd/rt/uv/uvll.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ pub enum uv_handle_type {
237237
UV_HANDLE_TYPE_MAX
238238
}
239239

240+
#[cfg(unix)]
240241
#[deriving(Eq)]
241242
pub enum uv_req_type {
242243
UV_UNKNOWN_REQ,
@@ -251,6 +252,31 @@ pub enum uv_req_type {
251252
UV_REQ_TYPE_MAX
252253
}
253254

255+
// uv_req_type may have additional fields defined by UV_REQ_TYPE_PRIVATE.
256+
// See UV_REQ_TYPE_PRIVATE at libuv/include/uv-win.h
257+
#[cfg(windows)]
258+
#[deriving(Eq)]
259+
pub enum uv_req_type {
260+
UV_UNKNOWN_REQ,
261+
UV_REQ,
262+
UV_CONNECT,
263+
UV_WRITE,
264+
UV_SHUTDOWN,
265+
UV_UDP_SEND,
266+
UV_FS,
267+
UV_WORK,
268+
UV_GETADDRINFO,
269+
UV_ACCEPT,
270+
UV_FS_EVENT_REQ,
271+
UV_POLL_REQ,
272+
UV_PROCESS_EXIT,
273+
UV_READ,
274+
UV_UDP_RECV,
275+
UV_WAKEUP,
276+
UV_SIGNAL_REQ,
277+
UV_REQ_TYPE_MAX
278+
}
279+
254280
#[deriving(Eq)]
255281
pub enum uv_membership {
256282
UV_LEAVE_GROUP,
@@ -298,10 +324,8 @@ fn handle_sanity_check() {
298324
}
299325

300326
#[test]
301-
#[ignore(cfg(windows))] // FIXME #8817
302-
#[fixed_stack_segment]
303-
#[inline(never)]
304327
fn request_sanity_check() {
328+
#[fixed_stack_segment]; #[inline(never)];
305329
unsafe {
306330
assert_eq!(UV_REQ_TYPE_MAX as uint, rust_uv_req_type_max());
307331
}

0 commit comments

Comments
 (0)