Skip to content

Commit

Permalink
fix: fix compile on windows (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler authored Aug 30, 2023
1 parent 5300721 commit 646c615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# this should match the nightly version in tari-project/tari
# only used for cargo fmt settings, repo should always compile on stable too
[toolchain]
channel = "nightly-2022-11-03"
channel = "stable"
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ impl RandomXDataset {
0 => Err(RandomXError::Other("Dataset item count was 0".to_string())),
x => {
// This weirdness brought to you by c_ulong being different on Windows and Linux
Ok(u32::try_from(x)?)
#[cfg(target_os = "windows")]
return Ok(x);
#[cfg(target_os = "linux")]
return Ok(u32::try_from(x)?);
},
}
}
Expand Down

0 comments on commit 646c615

Please sign in to comment.