diff options
| author | Meco Man <[email protected]> | 2021-12-21 12:25:30 -0500 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2021-12-27 00:51:22 +0800 |
| commit | 923fb0c146ca11dd868834c6a6008de4ef9e483c (patch) | |
| tree | d600064bcf671ffad75a6fd88efe29ac5a02684a /include | |
| parent | d16ca48f902ee0cdc467f166a219e6e2c8af57c7 (diff) | |
[rtdef] re-implement RT_UNUSED
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index b45b304aa8..2cf63b6a4c 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -37,6 +37,7 @@ * 2021-03-19 Meco Man add security devices * 2021-05-10 armink change version number to v4.0.4 * 2021-11-19 Meco Man change version number to v4.1.0 + * 2021-12-21 Meco Man re-implement RT_UNUSED */ #ifndef __RT_DEF_H__ @@ -118,14 +119,14 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define __CLANG_ARM #endif +#define RT_UNUSED(x) ((void)x) + /* Compiler Related Definitions */ #if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */ #include <stdarg.h> #define RT_SECTION(x) __attribute__((section(x))) - #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) - #define RT_WEAK __attribute__((weak)) #define rt_inline static __inline /* module compiling */ @@ -133,19 +134,16 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define RTT_API __declspec(dllimport) #else #define RTT_API __declspec(dllexport) - #endif - + #endif /* RT_USING_MODULE */ #elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */ #include <stdarg.h> #define RT_SECTION(x) @ x - #define RT_UNUSED #define RT_USED __root #define PRAGMA(x) _Pragma(#x) #define ALIGN(n) PRAGMA(data_alignment=n) #define RT_WEAK __weak #define rt_inline static inline #define RTT_API - #elif defined (__GNUC__) /* GNU GCC Compiler */ #ifdef RT_USING_NEWLIB #include <stdarg.h> @@ -156,10 +154,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) - #endif - + #endif /* RT_USING_NEWLIB */ #define RT_SECTION(x) __attribute__((section(x))) - #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) #define RT_WEAK __attribute__((weak)) @@ -168,7 +164,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */ #include <stdarg.h> #define RT_SECTION(x) __attribute__((section(x))) - #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) #define RT_WEAK __attribute__((weak)) @@ -177,7 +172,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #elif defined (_MSC_VER) #include <stdarg.h> #define RT_SECTION(x) - #define RT_UNUSED #define RT_USED #define ALIGN(n) __declspec(align(n)) #define RT_WEAK @@ -189,7 +183,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ * GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more * details. */ #define RT_SECTION(x) - #define RT_UNUSED #define RT_USED #define PRAGMA(x) _Pragma(#x) #define ALIGN(n) @@ -199,7 +192,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #elif defined (__TASKING__) #include <stdarg.h> #define RT_SECTION(x) __attribute__((section(x))) - #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used, protect)) #define PRAGMA(x) _Pragma(#x) #define ALIGN(n) __attribute__((__align(n))) |
