summaryrefslogtreecommitdiff
path: root/libc-test/build.rs
diff options
context:
space:
mode:
authorTom Parker-Shemilt <palfrey@tevp.net>2018-11-21 23:47:26 +0000
committerTom Parker-Shemilt <palfrey@tevp.net>2018-11-21 23:55:01 +0000
commitd931cd27eab1c5fc8d1075ae2009e1be343860d9 (patch)
treebfff212794ecfbd0b8c80b3fc0577ee118ead0dd /libc-test/build.rs
parenta145cf74318a85e7dd156d3c1b4de2d7df1e0c70 (diff)
parent5b403753da9ec8ff501adf34cb6d63b319b4a3ae (diff)
downloadrust-libc-d931cd27eab1c5fc8d1075ae2009e1be343860d9.tar.gz
Merge branch 'master' into strcase-various
Diffstat (limited to 'libc-test/build.rs')
-rw-r--r--libc-test/build.rs69
1 files changed, 51 insertions, 18 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 7250290c72..e016d38216 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -356,9 +356,10 @@ fn main() {
cfg.type_name(move |ty, is_struct, is_union| {
match ty {
// Just pass all these through, no need for a "struct" prefix
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr" | "Elf32_Shdr"
- | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
- | "Elf32_Chdr" | "Elf64_Chdr" => ty.to_string(),
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
+ | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
+ | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
+ | "Elf64_Chdr" => ty.to_string(),
// Fixup a few types on windows that don't actually exist.
"time64_t" if windows => "__time64_t".to_string(),
@@ -393,8 +394,12 @@ fn main() {
let target2 = target.clone();
cfg.field_name(move |struct_, field| {
match field {
- "st_birthtime" if openbsd && struct_ == "stat" => "__st_birthtime".to_string(),
- "st_birthtime_nsec" if openbsd && struct_ == "stat" => "__st_birthtimensec".to_string(),
+ "st_birthtime" if openbsd && struct_ == "stat" => {
+ "__st_birthtime".to_string()
+ }
+ "st_birthtime_nsec" if openbsd && struct_ == "stat" => {
+ "__st_birthtimensec".to_string()
+ }
// Our stat *_nsec fields normally don't actually exist but are part
// of a timeval struct
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
@@ -461,8 +466,9 @@ fn main() {
// Present on historical versions of iOS but missing in more recent
// SDKs
- "bpf_hdr" | "proc_taskinfo" | "proc_taskallinfo" | "proc_bsdinfo"
- | "proc_threadinfo" | "sockaddr_inarp" | "sockaddr_ctl" | "arphdr"
+ "bpf_hdr" | "proc_taskinfo" | "proc_taskallinfo"
+ | "proc_bsdinfo" | "proc_threadinfo" | "sockaddr_inarp"
+ | "sockaddr_ctl" | "arphdr"
if ios =>
{
true
@@ -474,7 +480,10 @@ fn main() {
cfg.skip_signededness(move |c| {
match c {
- "LARGE_INTEGER" | "mach_timebase_info_data_t" | "float" | "double" => true,
+ "LARGE_INTEGER"
+ | "mach_timebase_info_data_t"
+ | "float"
+ | "double" => true,
// uuid_t is a struct, not an integer.
"uuid_t" if dragonfly => true,
n if n.starts_with("pthread") => true,
@@ -514,7 +523,12 @@ fn main() {
// Skip constants not defined in MUSL but just passed down to the
// kernel regardless
- "RLIMIT_NLIMITS" | "TCP_COOKIE_TRANSACTIONS" | "RLIMIT_RTTIME" | "MSG_COPY" if musl => {
+ "RLIMIT_NLIMITS"
+ | "TCP_COOKIE_TRANSACTIONS"
+ | "RLIMIT_RTTIME"
+ | "MSG_COPY"
+ if musl =>
+ {
true
}
// work around super old mips toolchain
@@ -534,11 +548,16 @@ fn main() {
// These constants were removed in FreeBSD 11 (svn r262489),
// and they've never had any legitimate use outside of the
// base system anyway.
- "CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "NET_MAXID" | "USER_MAXID" if freebsd => true,
+ "CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "NET_MAXID"
+ | "USER_MAXID"
+ if freebsd =>
+ {
+ true
+ }
// These constants were added in FreeBSD 11
- "EVFILT_PROCDESC" | "EVFILT_SENDFILE" | "EVFILT_EMPTY" | "PD_CLOEXEC"
- | "PD_ALLOWED_AT_FORK"
+ "EVFILT_PROCDESC" | "EVFILT_SENDFILE" | "EVFILT_EMPTY"
+ | "PD_CLOEXEC" | "PD_ALLOWED_AT_FORK"
if freebsd =>
{
true
@@ -615,13 +634,19 @@ fn main() {
// These constants are tested in a separate test program generated below because there
// are header conflicts if we try to include the headers that define them here.
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true,
- "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => true,
- "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips && linux => true, // Only on MIPS
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => true,
+ "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1"
+ if mips && linux =>
+ {
+ true
+ } // Only on MIPS
"BOTHER" => true,
"MFD_CLOEXEC" | "MFD_ALLOW_SEALING" if !mips && musl => true,
- "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK" | "DT_SOCK"
+ "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG"
+ | "DT_LNK" | "DT_SOCK"
if solaris =>
{
true
@@ -630,7 +655,10 @@ fn main() {
"PRIO_MIN" | "PRIO_MAX" if solaris => true,
// These are defined for Solaris 11, but the crate is tested on illumos, where they are currently not defined
- "EADI" | "PORT_SOURCE_POSTWAIT" | "PORT_SOURCE_SIGNAL" | "PTHREAD_STACK_MIN" => true,
+ "EADI"
+ | "PORT_SOURCE_POSTWAIT"
+ | "PORT_SOURCE_SIGNAL"
+ | "PTHREAD_STACK_MIN" => true,
// These change all the time from release to release of linux
// distros, let's just not bother trying to verify them. They
@@ -901,8 +929,13 @@ fn main() {
cfg.header("asm/termbits.h");
cfg.skip_const(move |name| match name {
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false,
- "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => false,
- "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips && linux => false,
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW"
+ | "F_SEAL_WRITE" => false,
+ "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1"
+ if mips && linux =>
+ {
+ false
+ }
"BOTHER" => false,
_ => true,
});