Skip to content

Commit 64bc745

Browse files
committed
Properly define freebsd11 attribute
1 parent bde8b84 commit 64bc745

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ fn main() {
1616
}
1717

1818
if env::var("LIBC_CI").is_ok() {
19+
if let Some(11) = which_freebsd() {
20+
println!("cargo:rustc-cfg=freebsd11");
21+
}
1922
if let Some(12) = which_freebsd() {
2023
println!("cargo:rustc-cfg=freebsd12");
2124
}

libc-test/build.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,15 +1450,12 @@ fn test_freebsd(target: &str) {
14501450

14511451
let freebsd_ver = which_freebsd();
14521452

1453-
if let Some(12) = freebsd_ver {
1454-
// If the host is FreeBSD 12, run FreeBSD 12 tests
1455-
cfg.cfg("freebsd12", None);
1456-
}
1457-
1458-
if let Some(13) = freebsd_ver {
1459-
// If the host is FreeBSD 12, run FreeBSD 12 tests
1460-
cfg.cfg("freebsd13", None);
1461-
}
1453+
match freebsd_ver {
1454+
Some(11) => cfg.cfg("freebsd11", None),
1455+
Some(12) => cfg.cfg("freebsd12", None),
1456+
Some(13) => cfg.cfg("freebsd13", None),
1457+
_ => &mut cfg
1458+
};
14621459

14631460
// Required for `getline`:
14641461
cfg.define("_WITH_GETLINE", None);

0 commit comments

Comments
 (0)