summaryrefslogtreecommitdiff
path: root/libc-test
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-10-18 18:55:41 -0700
committerBryant Mairs <bryant@mai.rs>2017-10-18 21:14:43 -0700
commit6d55c2496df043f8f631b9b14e69fd5c5e3d4e97 (patch)
tree51c885abe7dd5b1199d3e4d0f9833a57587d5c12 /libc-test
parent12cfa1ef4662a790b8e2145b1b0eb7e22bb19607 (diff)
downloadrust-libc-6d55c2496df043f8f631b9b14e69fd5c5e3d4e97.tar.gz
Add termios2 for Android & Linux
Note that termios2 doesn't exist on powerpc(64), termios is used instead.
Diffstat (limited to 'libc-test')
-rw-r--r--libc-test/build.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 288fdaf8d5..f88048e8f3 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -377,6 +377,10 @@ fn main() {
// FIXME: unskip it for next major release
"stat" | "stat64" if android => true,
+ // These are tested as part of the linux_fcntl tests since there are
+ // header conflicts when including them with all the other structs.
+ "termios2" => true,
+
_ => false
}
});
@@ -671,8 +675,7 @@ fn main() {
// fails on a lot of platforms.
let mut cfg = ctest::TestGenerator::new();
cfg.skip_type(|_| true)
- .skip_struct(|_| true)
- .skip_fn(|_| true);
+ .skip_fn(|_| true);
if android || linux {
// musl defines these directly in `fcntl.h`
if musl {
@@ -695,8 +698,18 @@ fn main() {
_ => true,
}
});
+ cfg.skip_struct(|s| {
+ s != "termios2"
+ });
+ cfg.type_name(move |ty, is_struct| {
+ match ty {
+ t if is_struct => format!("struct {}", t),
+ t => t.to_string(),
+ }
+ });
} else {
cfg.skip_const(|_| true);
+ cfg.skip_struct(|_| true);
}
cfg.generate("../src/lib.rs", "linux_fcntl.rs");
}