-
Notifications
You must be signed in to change notification settings - Fork 8
/
ffi.patch
46 lines (45 loc) · 1.36 KB
/
ffi.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- src/ffi.rs.orig 2017-04-14 12:35:59.025213550 +0100
+++ src/ffi.rs 2017-04-14 12:36:38.286016787 +0100
@@ -1,4 +1,12 @@
/* automatically generated by rust-bindgen */
+#![allow(non_camel_case_types, non_snake_case)]
+use c_types::fd_set;
+use c_types::hostent;
+use c_types::in_addr;
+use c_types::iovec;
+use c_types::sockaddr;
+use c_types::socklen_t;
+use libc::timeval;
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
@@ -26,7 +34,10 @@
}
pub type ares_socklen_t = socklen_t;
pub type ares_ssize_t = isize;
-pub type ares_socket_t = ::std::os::raw::c_int;
+#[cfg(windows)]
+pub type ares_socket_t = ::std::os::windows::io::RawSocket;
+#[cfg(unix)]
+pub type ares_socket_t = ::std::os::unix::io::RawFd;
pub type ares_sock_state_cb =
::std::option::Option<unsafe extern "C" fn(data:
*mut ::std::os::raw::c_void,
@@ -63,6 +74,9 @@
impl Clone for ares_options {
fn clone(&self) -> Self { *self }
}
+impl Default for ares_options {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_channeldata([u8; 0]);
@@ -378,7 +392,7 @@
fn clone(&self) -> Self { *self }
}
#[repr(C)]
-#[derive(Debug, Copy)]
+#[derive(Copy)]
pub struct ares_addrttl {
pub ipaddr: in_addr,
pub ttl: ::std::os::raw::c_int,