Skip to content

Commit 550dd26

Browse files
committed
Adhere to coding guidelines
1 parent 9ccb4b1 commit 550dd26

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
@@ -3056,7 +3056,10 @@ fn test_neutrino(target: &str) {
30563056

30573057
let mut cfg = ctest_cfg();
30583058
if target.ends_with("_iosock") {
3059-
cfg.include(concat!(env!("QNX_TARGET"), "/usr/include/io-sock"));
3059+
let qnx_target_val = std::env::var("QNX_TARGET")
3060+
.unwrap_or_else(|_| "QNX_TARGET_not_set_please_source_qnxsdp".into());
3061+
3062+
cfg.include(qnx_target_val + "/usr/include/io-sock");
30603063
headers! { cfg:
30613064
"io-sock.h",
30623065
"sys/types.h",

src/unix/mod.rs

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

338338
cfg_if! {
339339
if #[cfg(target_os = "nto")] {
340-
pub const FNM_PERIOD: c_int = 1 << 1;}
341-
else {
340+
pub const FNM_PERIOD: c_int = 1 << 1;
341+
} else {
342342
pub const FNM_PERIOD: c_int = 1 << 2;
343343
}
344344
}
@@ -360,12 +360,22 @@ cfg_if! {
360360
target_os = "openbsd",
361361
))] {
362362
pub const FNM_PATHNAME: c_int = 1 << 1;
363-
pub const FNM_NOESCAPE: c_int = 1 << 0;
364363
} else {
365364
pub const FNM_PATHNAME: c_int = 1 << 0;
366-
#[cfg(target_os = "nto")]
365+
}
366+
}
367+
368+
cfg_if! {
369+
if #[cfg(any(
370+
target_os = "macos",
371+
target_os = "freebsd",
372+
target_os = "android",
373+
target_os = "openbsd",
374+
))] {
375+
pub const FNM_NOESCAPE: c_int = 1 << 0;
376+
} else if #[cfg(target_os = "nto")] {
367377
pub const FNM_NOESCAPE: c_int = 1 << 2;
368-
#[cfg(not(target_os = "nto"))]
378+
} else {
369379
pub const FNM_NOESCAPE: c_int = 1 << 1;
370380
}
371381
}

0 commit comments

Comments
 (0)