X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Furcu%2Fuatomic.h;h=561c8294f3faf1d8afeedb12ea97bbbde9eacdad;hb=HEAD;hp=5365f1fb0fdac0159edb06835f639b3045cc79eb;hpb=d18544842bdfbf2cba6c194a8e8d305ddf5e295e;p=urcu.git diff --git a/include/urcu/uatomic.h b/include/urcu/uatomic.h index 5365f1f..561c829 100644 --- a/include/urcu/uatomic.h +++ b/include/urcu/uatomic.h @@ -5,9 +5,8 @@ #ifndef _URCU_UATOMIC_H #define _URCU_UATOMIC_H -#include - #include +#include #include enum cmm_memorder { @@ -25,14 +24,12 @@ enum cmm_memorder { /* * Make sure that CMM_SEQ_CST_FENCE is not equivalent to other memory orders. */ -# ifdef static_assert -static_assert(CMM_RELAXED == __ATOMIC_RELAXED, ""); -static_assert(CMM_CONSUME == __ATOMIC_CONSUME, ""); -static_assert(CMM_ACQUIRE == __ATOMIC_ACQUIRE, ""); -static_assert(CMM_RELEASE == __ATOMIC_RELEASE, ""); -static_assert(CMM_ACQ_REL == __ATOMIC_ACQ_REL, ""); -static_assert(CMM_SEQ_CST == __ATOMIC_SEQ_CST, ""); -# endif +urcu_static_assert(CMM_RELAXED == __ATOMIC_RELAXED, "CMM_RELAXED vs __ATOMIC_RELAXED values mismatch", cmm_relaxed_values_mismatch); +urcu_static_assert(CMM_CONSUME == __ATOMIC_CONSUME, "CMM_CONSUME vs __ATOMIC_CONSUME values mismatch", cmm_consume_values_mismatch); +urcu_static_assert(CMM_ACQUIRE == __ATOMIC_ACQUIRE, "CMM_ACQUIRE vs __ATOMIC_ACQUIRE values mismatch", cmm_acquire_values_mismatch); +urcu_static_assert(CMM_RELEASE == __ATOMIC_RELEASE, "CMM_RELEASE vs __ATOMIC_RELEASE values mismatch", cmm_release_values_mismatch); +urcu_static_assert(CMM_ACQ_REL == __ATOMIC_ACQ_REL, "CMM_ACQ_REL vs __ATOMIC_ACQ_REL values mismatch", cmm_acq_rel_values_mismatch); +urcu_static_assert(CMM_SEQ_CST == __ATOMIC_SEQ_CST, "CMM_SEQ_CST vs __ATOMIC_SEQ_CST values mismatch", cmm_seq_cst_values_mismatch); /* * This is not part of the public API. It it used internally to implement the @@ -96,6 +93,8 @@ static inline int cmm_to_c11(int mo) #include #elif defined(URCU_ARCH_RISCV) #include +#elif defined(URCU_ARCH_LOONGARCH) +#include #else #error "Cannot build: unrecognized architecture, see ." #endif