Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[atomic]修复bsp/simulator vs2019编译下 atomic 两个volatile的问题 #7736

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[atomic]修复 atomic 两个 volatile 的问题
  • Loading branch information
zhkag committed Jun 28, 2023
commit 46beac9a42fc590ba8fb67f7eca3659d252ecb83
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