Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit e8424f1

Browse files
committed
Use portable-atomic to support PowerPC
Use the portable-atomic crate to fix build failure on PowerPC target that does not support 64-bit atomics natively: ``` error[E0432]: unresolved import `std::sync::atomic::AtomicU64` --> src/archive.rs:7:18 | 7 | atomic::{AtomicU64, Ordering}, | ^^^^^^^^^ | | | no `AtomicU64` in `sync::atomic` | help: a similar name exists in the module: `AtomicU32` For more information about this error, try `rustc --explain E0432`. error: could not compile `tokio-tar` (lib) due to 1 previous error ```
1 parent 87338a7 commit e8424f1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ contents are never required to be entirely resident in memory all at once.
2626
[dependencies]
2727
filetime = "0.2"
2828
futures-core = "0.3"
29+
portable-atomic = "1"
2930
tokio = { version = "1", features = ["fs", "io-util", "rt"] }
3031
tokio-stream = "0.1"
3132

src/archive.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ use std::{
33
collections::VecDeque,
44
path::Path,
55
pin::Pin,
6-
sync::{
7-
atomic::{AtomicU64, Ordering},
8-
Arc,
9-
},
6+
sync::Arc,
107
task::{Context, Poll},
118
};
9+
use portable_atomic::{
10+
AtomicU64,
11+
Ordering,
12+
};
1213
use tokio::{
1314
io::{self, AsyncRead as Read, AsyncReadExt},
1415
sync::Mutex,

0 commit comments

Comments
 (0)