Skip to content

Commit

Permalink
Adhere to coding guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
flba-eb committed Dec 2, 2024
1 parent e8a8493 commit 1de98b8
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 263 deletions.
5 changes: 4 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,10 @@ fn test_neutrino(target: &str) {

let mut cfg = ctest_cfg();
if target.ends_with("_iosock") {
cfg.include(concat!(env!("QNX_TARGET"), "/usr/include/io-sock"));
let qnx_target_val = std::env::var("QNX_TARGET")
.unwrap_or_else(|_| "QNX_TARGET_not_set_please_source_qnxsdp".into());

cfg.include(qnx_target_val + "/usr/include/io-sock");
headers! { cfg:
"io-sock.h",
"sys/types.h",
Expand Down
20 changes: 15 additions & 5 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ pub const ATF_USETRAILERS: c_int = 0x10;

cfg_if! {
if #[cfg(target_os = "nto")] {
pub const FNM_PERIOD: c_int = 1 << 1;}
else {
pub const FNM_PERIOD: c_int = 1 << 1;
} else {
pub const FNM_PERIOD: c_int = 1 << 2;
}
}
Expand All @@ -359,12 +359,22 @@ cfg_if! {
target_os = "openbsd",
))] {
pub const FNM_PATHNAME: c_int = 1 << 1;
pub const FNM_NOESCAPE: c_int = 1 << 0;
} else {
pub const FNM_PATHNAME: c_int = 1 << 0;
#[cfg(target_os = "nto")]
}
}

cfg_if! {
if #[cfg(any(
target_os = "macos",
target_os = "freebsd",
target_os = "android",
target_os = "openbsd",
))] {
pub const FNM_NOESCAPE: c_int = 1 << 0;
} else if #[cfg(target_os = "nto")] {
pub const FNM_NOESCAPE: c_int = 1 << 2;
#[cfg(not(target_os = "nto"))]
} else {
pub const FNM_NOESCAPE: c_int = 1 << 1;
}
}
Expand Down
Loading

0 comments on commit 1de98b8

Please sign in to comment.