File: use-portable-atomic-when-needed.patch

package info (click to toggle)
rust-boxcar 0.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 196 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Index: rust-boxcar-0.2.6/Cargo.toml
===================================================================
--- rust-boxcar-0.2.6.orig/Cargo.toml
+++ rust-boxcar-0.2.6/Cargo.toml
@@ -41,3 +41,6 @@ harness = false
 
 [dev-dependencies.criterion]
 version = "0.3.5"
+
+[target.'cfg(not(target_has_atomic = "64"))'.dependencies.portable-atomic]
+version = "1.9"
Index: rust-boxcar-0.2.6/src/raw.rs
===================================================================
--- rust-boxcar-0.2.6.orig/src/raw.rs
+++ rust-boxcar-0.2.6/src/raw.rs
@@ -3,7 +3,12 @@
 use core::cell::UnsafeCell;
 use core::mem::{self, MaybeUninit};
 use core::ops::Index;
-use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, AtomicUsize, Ordering};
+use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicUsize, Ordering};
+#[cfg(target_has_atomic = "64")]
+use core::sync::atomic::AtomicU64;
+#[cfg(not(target_has_atomic = "64"))]
+use portable_atomic::AtomicU64;
+
 use core::{ptr, slice};
 
 use alloc::boxed::Box;