From ad9c20950f7811b17fecbba82ec9419b3719fc84 Mon Sep 17 00:00:00 2001 From: Shell Date: Fri, 12 Apr 2024 06:48:54 +0800 Subject: [PATCH] [include] using signed atomic types --- include/rttypes.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/rttypes.h b/include/rttypes.h index 58e5a052e8..f697abf531 100644 --- a/include/rttypes.h +++ b/include/rttypes.h @@ -79,16 +79,16 @@ typedef rt_ubase_t rt_dev_t; /**< Type for device */ typedef rt_base_t rt_off_t; /**< Type for offset */ #ifdef __cplusplus -typedef rt_ubase_t rt_atomic_t; + typedef rt_base_t rt_atomic_t; #else -#if defined(RT_USING_HW_ATOMIC) -typedef rt_ubase_t rt_atomic_t; -#elif defined(RT_USING_STDC_ATOMIC) -#include -typedef atomic_size_t rt_atomic_t; -#else -typedef rt_ubase_t rt_atomic_t; -#endif /* RT_USING_STDC_ATOMIC */ + #if defined(RT_USING_HW_ATOMIC) + typedef rt_base_t rt_atomic_t; + #elif defined(RT_USING_STDC_ATOMIC) + #include + typedef atomic_intptr_t rt_atomic_t; + #else + typedef rt_base_t rt_atomic_t; + #endif /* RT_USING_STDC_ATOMIC */ #endif /* __cplusplus */ /* boolean type definitions */