diff options
author | Mitya Selivanov <0x7fffff@guattari.ru> | 2022-08-31 02:59:33 +0400 |
---|---|---|
committer | Mitya Selivanov <0x7fffff@guattari.ru> | 2022-08-31 02:59:33 +0400 |
commit | 0f844d54824e1a5b756d80ca6896d1cd2553bc1c (patch) | |
tree | 07f9e5bfdcba7cd280ac2de6717a67005791a236 | |
parent | e5987983d56afc7fcac6f3dcae065ded8255c034 (diff) | |
download | kit-0f844d54824e1a5b756d80ca6896d1cd2553bc1c.zip |
test
-rw-r--r-- | source/kit/atomic.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source/kit/atomic.h b/source/kit/atomic.h index b0235ad..98c9b0e 100644 --- a/source/kit/atomic.h +++ b/source/kit/atomic.h @@ -81,10 +81,8 @@ uint64_t kit_atomic_fetch_add_explicit_64(uint64_t volatile *var, # define atomic_store_explicit(var_, value_, memory_order_) \ do { \ static_assert(sizeof *(var_) == 1 || sizeof *(var_) == 2 || \ - sizeof *(var_) == 3 || sizeof *(var_) == 4, \ + sizeof *(var_) == 4 || sizeof *(var_) == 8, \ "Wrong atomic variable type"); \ - static_assert(sizeof(value_) <= sizeof *(var_), \ - "Wrong value type"); \ if (sizeof *(var_) == 1) \ kit_atomic_store_explicit_8((uint8_t volatile *) (var_), \ (uint8_t) (value_), \ @@ -105,7 +103,7 @@ uint64_t kit_atomic_fetch_add_explicit_64(uint64_t volatile *var, # define atomic_load_explicit(var_, memory_order_) \ (static_assert(sizeof *(var_) == 1 || sizeof *(var_) == 2 || \ - sizeof *(var_) == 3 || sizeof *(var_) == 4, \ + sizeof *(var_) == 4 || sizeof *(var_) == 8, \ "Wrong atomic variable type"), \ (sizeof *(var_) == 1 \ ? kit_atomic_load_explicit_8((uint8_t volatile *) (var_), \ @@ -122,10 +120,8 @@ uint64_t kit_atomic_fetch_add_explicit_64(uint64_t volatile *var, # define atomic_exchange_explicit(var_, value_, memory_order_) \ (static_assert(sizeof *(var_) == 1 || sizeof *(var_) == 2 || \ - sizeof *(var_) == 3 || sizeof *(var_) == 4, \ + sizeof *(var_) == 4 || sizeof *(var_) == 8, \ "Wrong atomic variable type"), \ - static_assert(sizeof(value_) <= sizeof *(var_), \ - "Wrong value type"), \ (sizeof *(var_) == 1 ? kit_atomic_exchange_explicit_8( \ (uint8_t volatile *) (var_), \ (uint8_t) (value_), (memory_order_)) \ @@ -143,10 +139,8 @@ uint64_t kit_atomic_fetch_add_explicit_64(uint64_t volatile *var, # define atomic_fetch_add_explicit(var_, value_, memory_order_) \ (static_assert(sizeof *(var_) == 1 || sizeof *(var_) == 2 || \ - sizeof *(var_) == 3 || sizeof *(var_) == 4, \ + sizeof *(var_) == 4 || sizeof *(var_) == 8, \ "Wrong atomic variable type"), \ - static_assert(sizeof(value_) <= sizeof *(var_), \ - "Wrong value type"), \ (sizeof *(var_) == 1 ? kit_atomic_fetch_add_explicit_8( \ (uint8_t volatile *) (var_), \ (uint8_t) (value_), (memory_order_)) \ |