fix: 64-bit atomics for platforms with no 64-bit atomics

Closes: #423
This commit is contained in:
NoisyCoil
2024-08-06 17:51:43 +02:00
committed by andy.boot
parent f48fcc790a
commit 489d9ada44
2 changed files with 9 additions and 1 deletions

View File

@@ -44,6 +44,9 @@ sysinfo = "0.27"
ctrlc = "3.4"
chrono = "0.4"
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.4"
[target.'cfg(windows)'.dependencies]
winapi-util = "0.1"
filesize = "0.2.0"

View File

@@ -3,7 +3,7 @@ use std::{
io::Write,
path::Path,
sync::{
atomic::{AtomicU64, AtomicU8, AtomicUsize, Ordering},
atomic::{AtomicU8, AtomicUsize, Ordering},
mpsc::{self, RecvTimeoutError, Sender},
Arc, RwLock,
},
@@ -11,6 +11,11 @@ use std::{
time::Duration,
};
#[cfg(not(target_has_atomic = "64"))]
use portable_atomic::AtomicU64;
#[cfg(target_has_atomic = "64")]
use std::sync::atomic::AtomicU64;
use crate::display::human_readable_number;
/* -------------------------------------------------------------------------- */