From 539bbafbf3160681d93f3889f7434287cee5a1b5 Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Wed, 6 Nov 2024 13:41:40 +0100 Subject: [PATCH] Fix definition of FNM_CASEFOLD for Illumos/Solaris Illumos reference (originally included in Solaris): https://github.com/illumos/illumos-gate/blob/aaceae985c2e78cadef76bf0b7b50ed887ccb3a6/usr/src/head/fnmatch.h#L41 (backport ) (cherry picked from commit 98a20b31de909c0d499de2db67482872430e6e04) --- src/unix/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 90d6f23b6a9a2..d26d9053558ee 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -314,9 +314,19 @@ pub const ATF_PUBL: ::c_int = 0x08; pub const ATF_USETRAILERS: ::c_int = 0x10; pub const FNM_PERIOD: c_int = 1 << 2; -pub const FNM_CASEFOLD: c_int = 1 << 4; pub const FNM_NOMATCH: c_int = 1; +cfg_if! { + if #[cfg(any( + target_os = "illumos", + target_os = "solaris", + ))] { + pub const FNM_CASEFOLD: c_int = 1 << 3; + } else { + pub const FNM_CASEFOLD: c_int = 1 << 4; + } +} + cfg_if! { if #[cfg(any( target_os = "macos",