Skip to content

Commit

Permalink
Merge pull request #447 from zardini123/exit_code_size
Browse files Browse the repository at this point in the history
Fixed Windows compile errors
  • Loading branch information
shepmaster authored Apr 3, 2024
2 parents 4936aa7 + adf7c01 commit 117aeee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ fn termination_returns_failure_code() {
fn nasty_hack_exit_code_eq(left: ExitCode, right: ExitCode) -> bool {
use std::mem;

let (left, right): (u8, u8) = unsafe {
assert_eq!(mem::size_of::<u8>(), mem::size_of::<ExitCode>());
#[cfg(target_os = "windows")]
type ExitCodeSize = u32;
#[cfg(not(target_os = "windows"))]
type ExitCodeSize = u8;

let (left, right): (ExitCodeSize, ExitCodeSize) = unsafe {
assert_eq!(mem::size_of::<ExitCodeSize>(), mem::size_of::<ExitCode>());
(mem::transmute(left), mem::transmute(right))
};

Expand Down

0 comments on commit 117aeee

Please sign in to comment.