Simplify rsconf has_symbol() libc lookups

This commit is contained in:
Mahmoud Al-Qudsi 2024-01-18 18:22:07 -06:00
parent a1147c7c4f
commit 21b4a2e5d6
3 changed files with 5 additions and 5 deletions

4
Cargo.lock generated
View file

@ -398,9 +398,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]] [[package]]
name = "rsconf" name = "rsconf"
version = "0.1.1" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38a9a3f6ff97f1bc63b490ea2d2c1570fd8372ab887b45dff59695ded372d576" checksum = "7b9653c00e095416c7586382524a5ede22b9dec6f067879bd7eed21429721e6d"
dependencies = [ dependencies = [
"cc", "cc",
] ]

View file

@ -42,7 +42,7 @@ serial_test = "0.4.0"
[build-dependencies] [build-dependencies]
cc = "1.0.83" cc = "1.0.83"
rsconf = "0.1.1" rsconf = "0.1.2"
[lib] [lib]
crate-type = ["rlib"] crate-type = ["rlib"]

View file

@ -88,13 +88,13 @@ fn detect_cfgs(target: Target) {
("gettext", &have_gettext), ("gettext", &have_gettext),
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3). // See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
("localeconv_l", &|target| { ("localeconv_l", &|target| {
Ok(target.has_symbol_in::<String>("localeconv_l", &[])) Ok(target.has_symbol("localeconv_l", None))
}), }),
("FISH_USE_POSIX_SPAWN", &|target| { ("FISH_USE_POSIX_SPAWN", &|target| {
Ok(target.has_header("spawn.h")) Ok(target.has_header("spawn.h"))
}), }),
("HAVE_PIPE2", &|target| { ("HAVE_PIPE2", &|target| {
Ok(target.has_symbol_in::<String>("pipe2", &[])) Ok(target.has_symbol("pipe2", None))
}), }),
("HAVE_EVENTFD", &|target| { ("HAVE_EVENTFD", &|target| {
Ok(target.has_header("sys/eventfd.h")) Ok(target.has_header("sys/eventfd.h"))