summaryrefslogtreecommitdiff
path: root/include/rtdef.h
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-12-11 13:12:03 -0500
committerGitHub <[email protected]>2022-12-11 13:12:03 -0500
commit99bdf978d7fe4ec18ed50a639e15b254825c871b (patch)
tree51ffb6f5fae10f2ce9a6baf4b861c025b8056fb6 /include/rtdef.h
parenta4b8762d8584b02a9b1f1c675a97ecaa105144be (diff)
[rtdef] use lower-case to define attributes (#6728)
* [rtdef] rename RT_WEAK attribute as rt_weak * [rtdef] rename RT_USED attribute as rt_used * [rtdef] rename RT_SECTION attribute as rt_section * [rtdef] rename ALIGN attribute as rt_align * [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
Diffstat (limited to 'include/rtdef.h')
-rw-r--r--include/rtdef.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/include/rtdef.h b/include/rtdef.h
index 393b589d36..d9a841b5b9 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -159,10 +159,10 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
/* Compiler Related Definitions */
#if defined(__ARMCC_VERSION) /* ARM Compiler */
-#define RT_SECTION(x) __attribute__((section(x)))
-#define RT_USED __attribute__((used))
-#define ALIGN(n) __attribute__((aligned(n)))
-#define RT_WEAK __attribute__((weak))
+#define rt_section(x) __attribute__((section(x)))
+#define rt_used __attribute__((used))
+#define rt_align(n) __attribute__((aligned(n)))
+#define rt_weak __attribute__((weak))
#define rt_inline static __inline
/* module compiling */
#ifdef RT_USING_MODULE
@@ -171,11 +171,11 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define RTT_API __declspec(dllexport)
#endif /* RT_USING_MODULE */
#elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */
-#define RT_SECTION(x) @ x
-#define RT_USED __root
+#define rt_section(x) @ x
+#define rt_used __root
#define PRAGMA(x) _Pragma(#x)
-#define ALIGN(n) PRAGMA(data_alignment=n)
-#define RT_WEAK __weak
+#define rt_align(n) PRAGMA(data_alignment=n)
+#define rt_weak __weak
#define rt_inline static inline
#define RTT_API
#elif defined (__GNUC__) /* GNU GCC Compiler */
@@ -189,51 +189,51 @@ typedef __gnuc_va_list va_list;
#endif /* RT_USING_LIBC */
#define __RT_STRINGIFY(x...) #x
#define RT_STRINGIFY(x...) __RT_STRINGIFY(x)
-#define RT_SECTION(x) __attribute__((section(x)))
-#define RT_USED __attribute__((used))
-#define ALIGN(n) __attribute__((aligned(n)))
-#define RT_WEAK __attribute__((weak))
+#define rt_section(x) __attribute__((section(x)))
+#define rt_used __attribute__((used))
+#define rt_align(n) __attribute__((aligned(n)))
+#define rt_weak __attribute__((weak))
#define rt_inline static __inline
#define RTT_API
#elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */
-#define RT_SECTION(x) __attribute__((section(x)))
-#define RT_USED __attribute__((used))
-#define ALIGN(n) __attribute__((aligned(n)))
-#define RT_WEAK __attribute__((weak))
+#define rt_section(x) __attribute__((section(x)))
+#define rt_used __attribute__((used))
+#define rt_align(n) __attribute__((aligned(n)))
+#define rt_weak __attribute__((weak))
#define rt_inline static inline
#define RTT_API
#elif defined (_MSC_VER)
-#define RT_SECTION(x)
-#define RT_USED
-#define ALIGN(n) __declspec(align(n))
-#define RT_WEAK
+#define rt_section(x)
+#define rt_used
+#define rt_align(n) __declspec(align(n))
+#define rt_weak
#define rt_inline static __inline
#define RTT_API
#elif defined (__TI_COMPILER_VERSION__)
/* The way that TI compiler set section is different from other(at least
* GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
* details. */
-#define RT_SECTION(x) __attribute__((section(x)))
+#define rt_section(x) __attribute__((section(x)))
#ifdef __TI_EABI__
-#define RT_USED __attribute__((retain)) __attribute__((used))
+#define rt_used __attribute__((retain)) __attribute__((used))
#else
-#define RT_USED __attribute__((used))
+#define rt_used __attribute__((used))
#endif
#define PRAGMA(x) _Pragma(#x)
-#define ALIGN(n) __attribute__((aligned(n)))
+#define rt_align(n) __attribute__((aligned(n)))
#ifdef __TI_EABI__
-#define RT_WEAK __attribute__((weak))
+#define rt_weak __attribute__((weak))
#else
-#define RT_WEAK
+#define rt_weak
#endif
#define rt_inline static inline
#define RTT_API
#elif defined (__TASKING__)
-#define RT_SECTION(x) __attribute__((section(x)))
-#define RT_USED __attribute__((used, protect))
+#define rt_section(x) __attribute__((section(x)))
+#define rt_used __attribute__((used, protect))
#define PRAGMA(x) _Pragma(#x)
-#define ALIGN(n) __attribute__((__align(n)))
-#define RT_WEAK __attribute__((weak))
+#define rt_align(n) __attribute__((__align(n)))
+#define rt_weak __attribute__((weak))
#define rt_inline static inline
#define RTT_API
#else
@@ -256,7 +256,7 @@ typedef int (*init_fn_t)(void);
const char __rti_level_##fn[] = ".rti_fn." level; \
const char __rti_##fn##_name[] = #fn; \
__declspec(allocate("rti_fn$f")) \
- RT_USED const struct rt_init_desc __rt_init_msc_##fn = \
+ rt_used const struct rt_init_desc __rt_init_msc_##fn = \
{__rti_level_##fn, fn, __rti_##fn##_name};
#else
struct rt_init_desc
@@ -267,7 +267,7 @@ typedef int (*init_fn_t)(void);
#define INIT_EXPORT(fn, level) \
const char __rti_level_##fn[] = ".rti_fn." level; \
__declspec(allocate("rti_fn$f")) \
- RT_USED const struct rt_init_desc __rt_init_msc_##fn = \
+ rt_used const struct rt_init_desc __rt_init_msc_##fn = \
{__rti_level_##fn, fn };
#endif
#else
@@ -279,11 +279,11 @@ typedef int (*init_fn_t)(void);
};
#define INIT_EXPORT(fn, level) \
const char __rti_##fn##_name[] = #fn; \
- RT_USED const struct rt_init_desc __rt_init_desc_##fn RT_SECTION(".rti_fn." level) = \
+ rt_used const struct rt_init_desc __rt_init_desc_##fn rt_section(".rti_fn." level) = \
{ __rti_##fn##_name, fn};
#else
#define INIT_EXPORT(fn, level) \
- RT_USED const init_fn_t __rt_init_##fn RT_SECTION(".rti_fn." level) = fn
+ rt_used const init_fn_t __rt_init_##fn rt_section(".rti_fn." level) = fn
#endif
#endif
#else