From cfc35e2748e5920374965e7e1d22bbf640649e33 Mon Sep 17 00:00:00 2001 From: zhangyu117 Date: Thu, 13 Aug 2026 22:20:39 +0800 Subject: [PATCH] nuttx/include/atomic.h: adjust the logic of "__ATOMIC_xxx" The memory order '__ATOMIC_xxx' is not a name specified by the standard. To achieve uniformity, if it is not defined, it will be defined one by one in the order of 0 to 5. Signed-off-by: zhangyu117 --- include/nuttx/atomic.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/nuttx/atomic.h b/include/nuttx/atomic.h index 65456d60382..02fb266a428 100644 --- a/include/nuttx/atomic.h +++ b/include/nuttx/atomic.h @@ -77,13 +77,31 @@ typedef volatile _Atomic int64_t atomic64_t; # endif #endif -#ifndef ATOMIC_FUNC +#ifndef __ATOMIC_RELAXED # define __ATOMIC_RELAXED 0 +#endif + +#ifndef __ATOMIC_CONSUME # define __ATOMIC_CONSUME 1 +#endif + +#ifndef __ATOMIC_ACQUIRE # define __ATOMIC_ACQUIRE 2 +#endif + +#ifndef __ATOMIC_RELEASE # define __ATOMIC_RELEASE 3 +#endif + +#ifndef __ATOMIC_ACQ_REL # define __ATOMIC_ACQ_REL 4 +#endif + +#ifndef __ATOMIC_SEQ_CST # define __ATOMIC_SEQ_CST 5 +#endif + +#ifndef ATOMIC_FUNC # define ATOMIC_FUNC(f, n) nx_atomic_##f##_##n