From 7f26c3ee804fb6ed458ef7fb0e3c794f14e0b3bc Mon Sep 17 00:00:00 2001 From: Pepper Gray Date: Sun, 19 Jul 2026 19:59:10 +0200 Subject: [PATCH] fix 32bit build: use portable-atomic building on 32bit fails with error: ```no `AtomicU64` in `sync::atomic``` add portable-atomic to use native types when available and emulate them when not. Bugs: #4331 Signed-off-by: Pepper Gray --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + src/utils/id.rs | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index b77d70df..2512ea50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2267,6 +2267,7 @@ dependencies = [ "pipewire", "pkg-config", "png", + "portable-atomic", "profiling", "proptest", "proptest-derive", @@ -2890,6 +2891,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "portable-atomic" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" + [[package]] name = "ppv-lite86" version = "0.2.21" diff --git a/Cargo.toml b/Cargo.toml index 49a75e3e..f27f81d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,6 +82,7 @@ pango = { version = "0.21.5", features = ["v1_44"] } pangocairo = "0.21.5" pipewire = { version = "0.10.0", optional = true, features = ["v0_3_33"] } png = "0.18.1" +portable-atomic = "1" profiling = "1.0.17" sd-notify = "0.5.0" serde.workspace = true diff --git a/src/utils/id.rs b/src/utils/id.rs index c21511e6..50755c55 100644 --- a/src/utils/id.rs +++ b/src/utils/id.rs @@ -1,4 +1,6 @@ -use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::atomic::Ordering; + +use portable_atomic::AtomicU64; /// Counter that returns unique IDs. pub struct IdCounter {