Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
"switch", "aix", "ohos", "hurd", "rtems", "visionos", "nuttx", "cygwin",
],
),
("target_env", &["illumos", "wasi", "aix", "ohos"]),
(
"target_env",
&["illumos", "wasi", "aix", "ohos", "nto71_iosock", "nto80"],
),
(
"target_arch",
&["loongarch64", "mips32r6", "mips64r6", "csky"],
Expand Down
20 changes: 20 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,20 @@ fn test_neutrino(target: &str) {
assert!(target.contains("nto-qnx"));

let mut cfg = ctest_cfg();
if target.ends_with("_iosock") {
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",
"sys/socket.h",
"sys/sysctl.h",
"net/if.h",
"net/if_arp.h"
}
}

headers! { cfg:
"ctype.h",
Expand Down Expand Up @@ -3377,6 +3391,9 @@ fn test_neutrino(target: &str) {
// Does not exist in Neutrino
"locale_t" => true,

// FIXME: "'__uint128' undeclared" in C
"__uint128" => true,

_ => false,
}
});
Expand Down Expand Up @@ -3437,6 +3454,9 @@ fn test_neutrino(target: &str) {
// stack unwinding bug.
"__my_thread_exit" => true,

// Wrong const-ness
"dl_iterate_phdr" => true,

_ => false,
}
});
Expand Down
23 changes: 21 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,13 @@ pub const ATF_PERM: c_int = 0x04;
pub const ATF_PUBL: c_int = 0x08;
pub const ATF_USETRAILERS: c_int = 0x10;

pub const FNM_PERIOD: c_int = 1 << 2;
cfg_if! {
if #[cfg(target_os = "nto")] {
pub const FNM_PERIOD: c_int = 1 << 1;
} else {
pub const FNM_PERIOD: c_int = 1 << 2;
}
}
pub const FNM_NOMATCH: c_int = 1;

cfg_if! {
Expand All @@ -353,9 +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_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;
} else {
pub const FNM_NOESCAPE: c_int = 1 << 1;
}
}
Expand Down
Loading
Loading