From 64bc745405116ff5eaa0358fb46bc2233e0756a7 Mon Sep 17 00:00:00 2001 From: Luca Pizzamiglio Date: Sun, 21 Jul 2019 18:10:40 +0200 Subject: [PATCH] Properly define freebsd11 attribute --- build.rs | 3 +++ libc-test/build.rs | 15 ++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.rs b/build.rs index c43cca36..f355447a 100644 --- a/build.rs +++ b/build.rs @@ -16,6 +16,9 @@ fn main() { } if env::var("LIBC_CI").is_ok() { + if let Some(11) = which_freebsd() { + println!("cargo:rustc-cfg=freebsd11"); + } if let Some(12) = which_freebsd() { println!("cargo:rustc-cfg=freebsd12"); } diff --git a/libc-test/build.rs b/libc-test/build.rs index 8dffc681..02e769ea 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1450,15 +1450,12 @@ fn test_freebsd(target: &str) { let freebsd_ver = which_freebsd(); - if let Some(12) = freebsd_ver { - // If the host is FreeBSD 12, run FreeBSD 12 tests - cfg.cfg("freebsd12", None); - } - - if let Some(13) = freebsd_ver { - // If the host is FreeBSD 12, run FreeBSD 12 tests - cfg.cfg("freebsd13", None); - } + match freebsd_ver { + Some(11) => cfg.cfg("freebsd11", None), + Some(12) => cfg.cfg("freebsd12", None), + Some(13) => cfg.cfg("freebsd13", None), + _ => &mut cfg + }; // Required for `getline`: cfg.define("_WITH_GETLINE", None);