Skip to content

Commit 61150a4

Browse files
psumberatgross35
authored andcommitted
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 <#4004>) (cherry picked from commit 98a20b3)
1 parent cd44558 commit 61150a4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/unix/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,19 @@ pub const ATF_PUBL: ::c_int = 0x08;
314314
pub const ATF_USETRAILERS: ::c_int = 0x10;
315315

316316
pub const FNM_PERIOD: c_int = 1 << 2;
317-
pub const FNM_CASEFOLD: c_int = 1 << 4;
318317
pub const FNM_NOMATCH: c_int = 1;
319318

319+
cfg_if! {
320+
if #[cfg(any(
321+
target_os = "illumos",
322+
target_os = "solaris",
323+
))] {
324+
pub const FNM_CASEFOLD: c_int = 1 << 3;
325+
} else {
326+
pub const FNM_CASEFOLD: c_int = 1 << 4;
327+
}
328+
}
329+
320330
cfg_if! {
321331
if #[cfg(any(
322332
target_os = "macos",

0 commit comments

Comments
 (0)