xiaoxiang781216 commented on code in PR #14827:
URL: https://github.com/apache/nuttx/pull/14827#discussion_r1866837107


##########
include/nuttx/atomic.h:
##########
@@ -81,16 +82,55 @@ extern "C++"
 #    if !(__clang__) && defined(__cplusplus)
 #      define _Atomic
 #    endif
-#    include <stdbool.h>
 #    include <stdatomic.h>
-#    ifndef ATOMIC_VAR_INIT
-#      define ATOMIC_VAR_INIT(value) (value)
-#    endif
-#  else
-#    include <nuttx/lib/stdatomic.h>
+#    define USE_STD_ATOMIC 1
 #  endif
+#endif
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#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
+
+#ifdef USE_STD_ATOMIC
+#  define ATOMIC_FUNC(f, n) atomic_##f##_explicit

Review Comment:
   let's define ATOMIC_FUNC directly and change to ATOMIC_FUNCNAME?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to