Skip to content

Commit

Permalink
Adhere to coding guidelines
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bartels <[email protected]>
  • Loading branch information
flba-eb committed Dec 18, 2024
1 parent ccb346d commit 1f6573b
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 @@ -3056,7 +3056,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 @@ -337,8 +337,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 @@ -360,12 +360,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 1f6573b

Please sign in to comment.