Rollup merge of #83013 - hyd-dev:cfg-unix-windows, r=bjorn3

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

This makes compilation to such targets (e.g. `wasm32-wasi`) easier.

cc rust-lang/miri#722 bb6d1d0a09 (r48100619)
This commit is contained in:
Yuki Okushi 2021-03-12 08:55:21 +09:00 committed by GitHub
commit 5ab8f53a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

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