[include]SECTION=>RT_SECTION(与catch2中SECTION冲突)

This commit is contained in:
liruncong 2021-02-09 23:25:16 +08:00
parent 09024c25f0
commit f5ede64c83
2 changed files with 11 additions and 11 deletions

View File

@ -117,7 +117,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
/* Compiler Related Definitions */
#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */
#include <stdarg.h>
#define SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
@ -133,7 +133,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */
#include <stdarg.h>
#define SECTION(x) @ x
#define RT_SECTION(x) @ x
#define RT_UNUSED
#define RT_USED __root
#define PRAGMA(x) _Pragma(#x)
@ -154,7 +154,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define va_arg(v,l) __builtin_va_arg(v,l)
#endif
#define SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
@ -163,7 +163,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define RTT_API
#elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */
#include <stdarg.h>
#define SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
@ -172,7 +172,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define RTT_API
#elif defined (_MSC_VER)
#include <stdarg.h>
#define SECTION(x)
#define RT_SECTION(x)
#define RT_UNUSED
#define RT_USED
#define ALIGN(n) __declspec(align(n))
@ -184,7 +184,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
/* 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 SECTION(x)
#define RT_SECTION(x)
#define RT_UNUSED
#define RT_USED
#define PRAGMA(x) _Pragma(#x)
@ -195,7 +195,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__TASKING__)
#include <stdarg.h>
#define SECTION(x)
#define RT_SECTION(x)
#define RT_UNUSED
#define RT_USED
#define PRAGMA(x) _Pragma(#x)
@ -222,11 +222,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 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 SECTION(".rti_fn." level) = fn
RT_USED const init_fn_t __rt_init_##fn RT_SECTION(".rti_fn." level) = fn
#endif
#endif
#else

View File

@ -28,8 +28,8 @@ __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs
#else
#define RTM_EXPORT(symbol) \
const char __rtmsym_##symbol##_name[] SECTION(".rodata.name") = #symbol; \
const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \
const char __rtmsym_##symbol##_name[] RT_SECTION(".rodata.name") = #symbol; \
const struct rt_module_symtab __rtmsym_##symbol RT_SECTION("RTMSymTab")= \
{ \
(void *)&symbol, \
__rtmsym_##symbol##_name \