Skip to content

Commit 1de98b8

Browse files
committed
Adhere to coding guidelines
1 parent e8a8493 commit 1de98b8

File tree

3 files changed

+173
-263
lines changed

3 files changed

+173
-263
lines changed

libc-test/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,10 @@ fn test_neutrino(target: &str) {
30323032

30333033
let mut cfg = ctest_cfg();
30343034
if target.ends_with("_iosock") {
3035-
cfg.include(concat!(env!("QNX_TARGET"), "/usr/include/io-sock"));
3035+
let qnx_target_val = std::env::var("QNX_TARGET")
3036+
.unwrap_or_else(|_| "QNX_TARGET_not_set_please_source_qnxsdp".into());
3037+
3038+
cfg.include(qnx_target_val + "/usr/include/io-sock");
30363039
headers! { cfg:
30373040
"io-sock.h",
30383041
"sys/types.h",

src/unix/mod.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ pub const ATF_USETRAILERS: c_int = 0x10;
336336

337337
cfg_if! {
338338
if #[cfg(target_os = "nto")] {
339-
pub const FNM_PERIOD: c_int = 1 << 1;}
340-
else {
339+
pub const FNM_PERIOD: c_int = 1 << 1;
340+
} else {
341341
pub const FNM_PERIOD: c_int = 1 << 2;
342342
}
343343
}
@@ -359,12 +359,22 @@ cfg_if! {
359359
target_os = "openbsd",
360360
))] {
361361
pub const FNM_PATHNAME: c_int = 1 << 1;
362-
pub const FNM_NOESCAPE: c_int = 1 << 0;
363362
} else {
364363
pub const FNM_PATHNAME: c_int = 1 << 0;
365-
#[cfg(target_os = "nto")]
364+
}
365+
}
366+
367+
cfg_if! {
368+
if #[cfg(any(
369+
target_os = "macos",
370+
target_os = "freebsd",
371+
target_os = "android",
372+
target_os = "openbsd",
373+
))] {
374+
pub const FNM_NOESCAPE: c_int = 1 << 0;
375+
} else if #[cfg(target_os = "nto")] {
366376
pub const FNM_NOESCAPE: c_int = 1 << 2;
367-
#[cfg(not(target_os = "nto"))]
377+
} else {
368378
pub const FNM_NOESCAPE: c_int = 1 << 1;
369379
}
370380
}

0 commit comments

Comments
 (0)