Skip to content

Commit

Permalink
Rollup merge of rust-lang#83013 - hyd-dev:cfg-unix-windows, r=bjorn3
Browse files Browse the repository at this point in the history
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 rust-lang@bb6d1d0#r48100619
  • Loading branch information
JohnTitor authored Mar 11, 2021
2 parents 02326d5 + 00c0872 commit 5ab8f53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5ab8f53

Please sign in to comment.