mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 04:58:28 +00:00
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 <zhangyu117@xiaomi.com>
This commit is contained in:
parent
1c7a946dee
commit
cfc35e2748
1 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue