diff --git a/Cargo.toml b/Cargo.toml index 175b40a13ea..9275c6658b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ cfg-if = "1.0" libc = "0.2.62" parking_lot = ">= 0.11, < 0.13" memoffset = "0.9" +portable-atomic = "1.0" # ffi bindings to the python interpreter, split into a separate crate so they can be used independently pyo3-ffi = { path = "pyo3-ffi", version = "=0.20.2" } diff --git a/newsfragments/3619.fixed.md b/newsfragments/3619.fixed.md new file mode 100644 index 00000000000..690542409f4 --- /dev/null +++ b/newsfragments/3619.fixed.md @@ -0,0 +1 @@ +Use portable-atomic to support platforms without 64-bit atomics diff --git a/src/impl_/pymodule.rs b/src/impl_/pymodule.rs index 8ec963455fc..7c5243fcf1c 100644 --- a/src/impl_/pymodule.rs +++ b/src/impl_/pymodule.rs @@ -3,7 +3,7 @@ use std::cell::UnsafeCell; #[cfg(all(not(PyPy), Py_3_9, not(all(windows, Py_LIMITED_API, not(Py_3_10)))))] -use std::sync::atomic::{AtomicI64, Ordering}; +use portable_atomic::{AtomicI64, Ordering}; #[cfg(not(PyPy))] use crate::exceptions::PyImportError;