xiaoxiang781216 commented on code in PR #14827: URL: https://github.com/apache/nuttx/pull/14827#discussion_r1868924210
########## include/nuttx/atomic.h: ########## @@ -27,72 +27,158 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> + #ifdef __has_include -# if defined(__cplusplus) && __has_include(<atomic>) +# if __has_include(<atomic>) && defined(__cplusplus) extern "C++" { # include <atomic> +# define ATOMIC_FUNC(f, n) atomic_##f##_explicit -# define ATOMIC_VAR_INIT(value) (value) - - using std::memory_order; - using std::atomic_bool; - using std::atomic_char; - using std::atomic_schar; - using std::atomic_uchar; - using std::atomic_short; - using std::atomic_ushort; - using std::atomic_int; - using std::atomic_uint; - using std::atomic_long; - using std::atomic_ulong; - using std::atomic_llong; - using std::atomic_ullong; - - using std::atomic_load; using std::atomic_load_explicit; - using std::atomic_store; using std::atomic_store_explicit; - using std::atomic_exchange; using std::atomic_exchange_explicit; - using std::atomic_compare_exchange_strong; using std::atomic_compare_exchange_strong_explicit; - using std::atomic_compare_exchange_weak; using std::atomic_compare_exchange_weak_explicit; - using std::atomic_flag_test_and_set; - using std::atomic_flag_test_and_set_explicit; - using std::atomic_flag_clear; - using std::atomic_flag_clear_explicit; - using std::atomic_fetch_add; using std::atomic_fetch_add_explicit; - using std::atomic_fetch_sub; using std::atomic_fetch_sub_explicit; - using std::atomic_fetch_and; using std::atomic_fetch_and_explicit; - using std::atomic_fetch_or; using std::atomic_fetch_or_explicit; - using std::atomic_fetch_xor; using std::atomic_fetch_xor_explicit; + + typedef volatile int32_t atomic_t; + typedef volatile int64_t atomic64_t; } # elif __has_include(<stdatomic.h>) && \ ((defined(__cplusplus) && __cplusplus >= 201103L) || \ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)) && \ !defined(__STDC_NO_ATOMICS__) -# if !(__clang__) && defined(__cplusplus) +# if !defined(__clang__) && defined(__cplusplus) Review Comment: but should we remove the reference to _Atomic inside nuttx? -- 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