Update atomic_impl macros to have same input syntax in all cfgs
This commit is contained in:
parent
37faaf295e
commit
0d79306285
@ -2662,7 +2662,7 @@ where
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))]
|
||||
macro_rules! atomic_impl {
|
||||
($($ty:ident)*) => {
|
||||
($($ty:ident $size:expr)*) => {
|
||||
$(
|
||||
impl<'de> Deserialize<'de> for $ty {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
@ -2678,7 +2678,7 @@ macro_rules! atomic_impl {
|
||||
|
||||
#[cfg(all(feature = "std", not(no_target_has_atomic)))]
|
||||
macro_rules! atomic_impl {
|
||||
($($ty:ident $size:expr),*) => {
|
||||
($($ty:ident $size:expr)*) => {
|
||||
$(
|
||||
#[cfg(target_has_atomic = $size)]
|
||||
impl<'de> Deserialize<'de> for $ty {
|
||||
@ -2695,28 +2695,35 @@ macro_rules! atomic_impl {
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))]
|
||||
atomic_impl! {
|
||||
AtomicBool
|
||||
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
||||
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
||||
AtomicBool "8"
|
||||
AtomicI8 "8"
|
||||
AtomicI16 "16"
|
||||
AtomicI32 "32"
|
||||
AtomicIsize "ptr"
|
||||
AtomicU8 "8"
|
||||
AtomicU16 "16"
|
||||
AtomicU32 "32"
|
||||
AtomicUsize "ptr"
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic64)))]
|
||||
atomic_impl! {
|
||||
AtomicI64 AtomicU64
|
||||
AtomicI64 "64"
|
||||
AtomicU64 "64"
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "std", not(no_target_has_atomic)))]
|
||||
atomic_impl! {
|
||||
AtomicBool "8",
|
||||
AtomicI8 "8",
|
||||
AtomicI16 "16",
|
||||
AtomicI32 "32",
|
||||
AtomicI64 "64",
|
||||
AtomicIsize "ptr",
|
||||
AtomicU8 "8",
|
||||
AtomicU16 "16",
|
||||
AtomicU32 "32",
|
||||
AtomicU64 "64",
|
||||
AtomicBool "8"
|
||||
AtomicI8 "8"
|
||||
AtomicI16 "16"
|
||||
AtomicI32 "32"
|
||||
AtomicI64 "64"
|
||||
AtomicIsize "ptr"
|
||||
AtomicU8 "8"
|
||||
AtomicU16 "16"
|
||||
AtomicU32 "32"
|
||||
AtomicU64 "64"
|
||||
AtomicUsize "ptr"
|
||||
}
|
||||
|
||||
|
@ -947,7 +947,7 @@ where
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))]
|
||||
macro_rules! atomic_impl {
|
||||
($($ty:ident)*) => {
|
||||
($($ty:ident $size:expr)*) => {
|
||||
$(
|
||||
impl Serialize for $ty {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
@ -964,7 +964,7 @@ macro_rules! atomic_impl {
|
||||
|
||||
#[cfg(all(feature = "std", not(no_target_has_atomic)))]
|
||||
macro_rules! atomic_impl {
|
||||
($($ty:ident $size:expr),*) => {
|
||||
($($ty:ident $size:expr)*) => {
|
||||
$(
|
||||
#[cfg(target_has_atomic = $size)]
|
||||
impl Serialize for $ty {
|
||||
@ -982,27 +982,34 @@ macro_rules! atomic_impl {
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))]
|
||||
atomic_impl! {
|
||||
AtomicBool
|
||||
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
||||
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
||||
AtomicBool "8"
|
||||
AtomicI8 "8"
|
||||
AtomicI16 "16"
|
||||
AtomicI32 "32"
|
||||
AtomicIsize "ptr"
|
||||
AtomicU8 "8"
|
||||
AtomicU16 "16"
|
||||
AtomicU32 "32"
|
||||
AtomicUsize "ptr"
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic64)))]
|
||||
atomic_impl! {
|
||||
AtomicI64 AtomicU64
|
||||
AtomicI64 "64"
|
||||
AtomicU64 "64"
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "std", not(no_target_has_atomic)))]
|
||||
atomic_impl! {
|
||||
AtomicBool "8",
|
||||
AtomicI8 "8",
|
||||
AtomicI16 "16",
|
||||
AtomicI32 "32",
|
||||
AtomicI64 "64",
|
||||
AtomicIsize "ptr",
|
||||
AtomicU8 "8",
|
||||
AtomicU16 "16",
|
||||
AtomicU32 "32",
|
||||
AtomicU64 "64",
|
||||
AtomicBool "8"
|
||||
AtomicI8 "8"
|
||||
AtomicI16 "16"
|
||||
AtomicI32 "32"
|
||||
AtomicI64 "64"
|
||||
AtomicIsize "ptr"
|
||||
AtomicU8 "8"
|
||||
AtomicU16 "16"
|
||||
AtomicU32 "32"
|
||||
AtomicU64 "64"
|
||||
AtomicUsize "ptr"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user