mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Merge pull request #3393 from devnexen/netbsd_build_fix
netbsd build fix proposal
This commit is contained in:
@@ -61,7 +61,7 @@ mod _socket {
|
||||
#[pyattr]
|
||||
use c::{AF_UNIX, SO_REUSEPORT};
|
||||
|
||||
#[cfg(not(target_os = "freebsd"))]
|
||||
#[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))]
|
||||
#[pyattr]
|
||||
use c::{AI_ADDRCONFIG, AI_ALL, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE};
|
||||
|
||||
|
||||
@@ -176,8 +176,11 @@ const ERROR_CODES: &[(&str, i32)] = &[
|
||||
e!(ENXIO),
|
||||
e!(ECANCELED),
|
||||
e!(EWOULDBLOCK),
|
||||
e!(cfg(not(windows)), EOWNERDEAD),
|
||||
e!(cfg(not(windows)), ENOTRECOVERABLE),
|
||||
e!(cfg(not(any(windows, target_os = "netbsd"))), EOWNERDEAD),
|
||||
e!(
|
||||
cfg(not(any(windows, target_os = "netbsd"))),
|
||||
ENOTRECOVERABLE
|
||||
),
|
||||
e!(cfg(windows), WSAEHOSTDOWN),
|
||||
e!(cfg(windows), WSAENETDOWN),
|
||||
e!(cfg(windows), WSAENOTSOCK),
|
||||
|
||||
@@ -1004,11 +1004,18 @@ pub(super) mod _os {
|
||||
fn from_stat(stat: &StatStruct, vm: &VirtualMachine) -> Self {
|
||||
let (atime, mtime, ctime);
|
||||
#[cfg(any(unix, windows))]
|
||||
#[cfg(not(target_os = "netbsd"))]
|
||||
{
|
||||
atime = (stat.st_atime, stat.st_atime_nsec);
|
||||
mtime = (stat.st_mtime, stat.st_mtime_nsec);
|
||||
ctime = (stat.st_ctime, stat.st_ctime_nsec);
|
||||
}
|
||||
#[cfg(target_os = "netbsd")]
|
||||
{
|
||||
atime = (stat.st_atime, stat.st_atimensec);
|
||||
mtime = (stat.st_mtime, stat.st_mtimensec);
|
||||
ctime = (stat.st_ctime, stat.st_ctimensec);
|
||||
}
|
||||
#[cfg(target_os = "wasi")]
|
||||
{
|
||||
atime = (stat.st_atim.tv_sec, stat.st_atim.tv_nsec);
|
||||
|
||||
@@ -97,7 +97,12 @@ pub(crate) mod _signal {
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_os = "freebsd")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "macos",
|
||||
target_os = "openbsd",
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd"
|
||||
)))]
|
||||
#[pyattr]
|
||||
pub use libc::{SIGPWR, SIGSTKFLT};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user