1
Fork 0

Adjust some #[cfg]s to take non-Unix non-Windows operating systems into account

This commit is contained in:
hyd-dev 2021-03-11 18:03:32 +08:00
parent 04fce73196
commit 00c08727c8
No known key found for this signature in database
GPG key ID: 74FA7FD5B8DA14B8

View file

@ -711,7 +711,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
status.signal() == Some(libc::SIGILL) status.signal() == Some(libc::SIGILL)
} }
#[cfg(windows)] #[cfg(not(unix))]
fn is_illegal_instruction(_status: &ExitStatus) -> bool { fn is_illegal_instruction(_status: &ExitStatus) -> bool {
false false
} }
@ -1198,7 +1198,7 @@ fn exec_linker(
flush_linked_file(&output, out_filename)?; flush_linked_file(&output, out_filename)?;
return output; return output;
#[cfg(unix)] #[cfg(not(windows))]
fn flush_linked_file(_: &io::Result<Output>, _: &Path) -> io::Result<()> { fn flush_linked_file(_: &io::Result<Output>, _: &Path) -> io::Result<()> {
Ok(()) Ok(())
} }
@ -1238,6 +1238,11 @@ fn exec_linker(
err.raw_os_error() == Some(ERROR_FILENAME_EXCED_RANGE) err.raw_os_error() == Some(ERROR_FILENAME_EXCED_RANGE)
} }
#[cfg(not(any(unix, windows)))]
fn command_line_too_big(_: &io::Error) -> bool {
false
}
struct Escape<'a> { struct Escape<'a> {
arg: &'a str, arg: &'a str,
is_like_msvc: bool, is_like_msvc: bool,