Fix various CI errors in PR #449

This commit is contained in:
Alan Somers 2016-11-13 13:52:34 -07:00
parent 4ec884ac6d
commit 9245e0727b
7 changed files with 28 additions and 10 deletions

View File

@ -298,6 +298,9 @@ fn main() {
// The alignment of this is 4 on 64-bit OSX...
"kevent" if apple && x86_64 => true,
// This is actually a union, not a struct
"sigval" => true,
_ => false
}
});
@ -427,6 +430,10 @@ fn main() {
// the symbol.
"uname" if freebsd => true,
// lio_listio confuses the checker, probably because one of its
// arguments is an array
"lio_listio" if freebsd => true,
_ => false,
}
});
@ -446,7 +453,11 @@ fn main() {
// sighandler_t type is super weird
(struct_ == "sigaction" && field == "sa_sigaction") ||
// __timeval type is a patch which doesn't exist in glibc
(linux && struct_ == "utmpx" && field == "ut_tv")
(linux && struct_ == "utmpx" && field == "ut_tv") ||
// sigval is actually a union, but we pretend it's a struct
(struct_ == "sigevent" && field == "sigev_value") ||
// aio_buf is "volatile void*" and Rust doesn't understand volatile
(struct_ == "aiocb" && field == "aio_buf")
});
cfg.skip_field(move |struct_, field| {
@ -456,7 +467,9 @@ fn main() {
// musl names this __dummy1 but it's still there
(musl && struct_ == "glob_t" && field == "gl_flags") ||
// musl seems to define this as an *anonymous* bitfield
(musl && struct_ == "statvfs" && field == "__f_unused")
(musl && struct_ == "statvfs" && field == "__f_unused") ||
// sigev_notify_thread_id is actually part of a sigev_un union
(struct_ == "sigevent" && field == "sigev_notify_thread_id")
});
cfg.fn_cname(move |name, cname| {

View File

@ -317,7 +317,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::intptr_t, //actually a union of int and void*
pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::pthread_attr_t
}

View File

@ -50,7 +50,7 @@ s! {
pub sigev_signo: ::c_int, //actually a union
#[cfg(target_pointer_width = "64")]
__unused1: ::c_int,
pub sigev_value: ::intptr_t, //actually a union of int and void*
pub sigev_value: ::sigval,
__unused2: *mut ::c_void //actually a function pointer
}

View File

@ -37,7 +37,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::intptr_t, //actually a union of int and void*
pub sigev_value: ::sigval,
//The rest of the structure is actually a union. We expose only
//sigev_notify_thread_id because it's the most useful union member.
pub sigev_notify_thread_id: ::lwpid_t,

View File

@ -46,7 +46,7 @@ s! {
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::intptr_t, //actually a union of int and void*
pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::c_void
}

View File

@ -119,6 +119,11 @@ s! {
pub l_onoff: ::c_int,
pub l_linger: ::c_int,
}
pub struct sigval {
// Actually a union of an int and a void*
pub sival_ptr: *mut ::c_void
}
}
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;

View File

@ -165,12 +165,12 @@ s! {
}
pub struct sigevent {
pub sigev_value: ::intptr_t, //actually a union of int and void*
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
// Actually a union. We only expose _tid because it's the most useful
// member
pub _tid: ::c_int,
// Actually a union. We only expose sigev_notify_thread_id because it's
// the most useful member
pub sigev_notify_thread_id: ::c_int,
#[cfg(target_pointer_width = "64")]
__unused1: [::c_int; 11],
#[cfg(target_pointer_width = "32")]