Skip to content

Commit

Permalink
[atomic]修复 atomic 两个 volatile 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhkag committed Jun 28, 2023
1 parent 53c4352 commit 46beac9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/rtdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#include <stdatomic.h>
typedef atomic_size_t rt_atomic_t;
#elif defined(RT_USING_HW_ATOMIC)
typedef volatile rt_base_t rt_atomic_t;
typedef rt_base_t rt_atomic_t;
#else

/* To detect std atomic */
#if defined(RT_USING_LIBC) && defined(__GNUC__) && !defined(__STDC_NO_ATOMICS__)
#include <stdatomic.h>
typedef atomic_size_t rt_atomic_t;
#else
typedef volatile rt_base_t rt_atomic_t;
typedef rt_base_t rt_atomic_t;
#endif /* __GNUC__ && !__STDC_NO_ATOMICS__ */

#endif /* RT_USING_STDC_ATOMIC */
Expand Down

0 comments on commit 46beac9

Please sign in to comment.