Skip to content

Commit

Permalink
Auto merge of #1306 - gnzlbg:fix_asmjs, r=gnzlbg
Browse files Browse the repository at this point in the history
Don't fix asmjs and wasm32 build jobs

This doesn't fix the jobs, but at least now libc-test reports no errors, even though they still fail to link.
  • Loading branch information
bors committed Mar 26, 2019
2 parents e1c9ad1 + 8abce83 commit 600f635
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 72 deletions.
26 changes: 11 additions & 15 deletions libc-test/build.rs
Expand Up @@ -1065,22 +1065,18 @@ fn test_openbsd(target: &str) {
}
});

cfg.field_name(move |struct_, field| {
match field {
"st_birthtime" if struct_.starts_with("stat") => {
"__st_birthtime".to_string()
}
"st_birthtime_nsec" if struct_.starts_with("stat") => {
"__st_birthtimensec".to_string()
}
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
s.replace("e_nsec", ".tv_nsec")
}
"sa_sigaction" if struct_ == "sigaction" => {
"sa_handler".to_string()
}
s => s.to_string(),
cfg.field_name(move |struct_, field| match field {
"st_birthtime" if struct_.starts_with("stat") => {
"__st_birthtime".to_string()
}
"st_birthtime_nsec" if struct_.starts_with("stat") => {
"__st_birthtimensec".to_string()
}
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
s.replace("e_nsec", ".tv_nsec")
}
"sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
s => s.to_string(),
});

cfg.skip_field_type(move |struct_, field| {
Expand Down
54 changes: 54 additions & 0 deletions src/unix/notbsd/android/mod.rs
Expand Up @@ -190,6 +190,13 @@ s! {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_int,
}

pub struct inotify_event {
pub wd: ::c_int,
pub mask: ::uint32_t,
pub cookie: ::uint32_t,
pub len: ::uint32_t
}
}

s_no_extra_traits!{
Expand Down Expand Up @@ -1356,6 +1363,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
Expand Down Expand Up @@ -1790,6 +1802,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;

// uapi/linux/inotify.h
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;

// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;

pub const IN_ALL_EVENTS: ::uint32_t = (
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
IN_MOVE_SELF
);

pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;

f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
Expand Down Expand Up @@ -2055,6 +2104,11 @@ extern {
flags: ::c_int) -> ::c_int;
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
flags: ::c_int, timeout: *const ::timespec) -> ::c_int;
pub fn inotify_init() -> ::c_int;
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
pub fn inotify_add_watch(fd: ::c_int,
path: *const ::c_char,
mask: ::uint32_t) -> ::c_int;
}

cfg_if! {
Expand Down
54 changes: 54 additions & 0 deletions src/unix/notbsd/linux/mod.rs
Expand Up @@ -493,6 +493,13 @@ s! {
pub updated: ::c_ulong,
pub ha: [::c_uchar; ::MAX_ADDR_LEN],
}

pub struct inotify_event {
pub wd: ::c_int,
pub mask: ::uint32_t,
pub cookie: ::uint32_t,
pub len: ::uint32_t
}
}

s_no_extra_traits!{
Expand Down Expand Up @@ -1409,6 +1416,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;

Expand Down Expand Up @@ -1800,6 +1812,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;

// uapi/linux/inotify.h
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;

// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;

pub const IN_ALL_EVENTS: ::uint32_t = (
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
IN_MOVE_SELF
);

pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;

f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
Expand Down Expand Up @@ -2385,6 +2434,11 @@ extern {
stream: *mut ::FILE
) -> ::size_t;
pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
pub fn inotify_init() -> ::c_int;
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
pub fn inotify_add_watch(fd: ::c_int,
path: *const ::c_char,
mask: ::uint32_t) -> ::c_int;
}

cfg_if! {
Expand Down
57 changes: 0 additions & 57 deletions src/unix/notbsd/mod.rs
Expand Up @@ -208,13 +208,6 @@ s! {
pub ar_op: u16,
}

pub struct inotify_event {
pub wd: ::c_int,
pub mask: ::uint32_t,
pub cookie: ::uint32_t,
pub len: ::uint32_t
}

pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
Expand Down Expand Up @@ -807,24 +800,18 @@ pub const IP_RECVTOS: ::c_int = 13;
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
pub const IP_TRANSPARENT: ::c_int = 19;
pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
pub const IPV6_MULTICAST_IF: ::c_int = 17;
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
pub const IPV6_V6ONLY: ::c_int = 26;
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
pub const IPV6_RECVPKTINFO: ::c_int = 49;
pub const IPV6_PKTINFO: ::c_int = 50;
pub const IPV6_RECVTCLASS: ::c_int = 66;
pub const IPV6_TCLASS: ::c_int = 67;

pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;

pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const TCP_CORK: ::c_int = 3;
Expand Down Expand Up @@ -1167,45 +1154,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
pub const ARPHRD_VOID: u16 = 0xFFFF;
pub const ARPHRD_NONE: u16 = 0xFFFE;

// uapi/linux/inotify.h
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;

pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;

pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;

// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;

pub const IN_ALL_EVENTS: ::uint32_t = (
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
IN_MOVE_SELF
);

pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;

fn CMSG_ALIGN(len: usize) -> usize {
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
}
Expand Down Expand Up @@ -1458,11 +1406,6 @@ extern {
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
-> ::ssize_t;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn inotify_init() -> ::c_int;
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
pub fn inotify_add_watch(fd: ::c_int,
path: *const ::c_char,
mask: ::uint32_t) -> ::c_int;
}

cfg_if! {
Expand Down

0 comments on commit 600f635

Please sign in to comment.