Browse Source

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

liruncong 4 years ago
parent
commit
f5ede64c83
2 changed files with 11 additions and 11 deletions
  1. 9 9
      include/rtdef.h
  2. 2 2
      include/rtm.h

+ 9 - 9
include/rtdef.h

@@ -117,7 +117,7 @@ typedef rt_base_t                       rt_off_t;       /**< Type for offset */
 /* Compiler Related Definitions */
 /* Compiler Related Definitions */
 #if defined(__CC_ARM) || defined(__CLANG_ARM)           /* ARM Compiler */
 #if defined(__CC_ARM) || defined(__CLANG_ARM)           /* ARM Compiler */
     #include <stdarg.h>
     #include <stdarg.h>
-    #define SECTION(x)                  __attribute__((section(x)))
+    #define RT_SECTION(x)               __attribute__((section(x)))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_USED                     __attribute__((used))
     #define RT_USED                     __attribute__((used))
     #define ALIGN(n)                    __attribute__((aligned(n)))
     #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 */
 #elif defined (__IAR_SYSTEMS_ICC__)     /* for IAR Compiler */
     #include <stdarg.h>
     #include <stdarg.h>
-    #define SECTION(x)                  @ x
+    #define RT_SECTION(x)               @ x
     #define RT_UNUSED
     #define RT_UNUSED
     #define RT_USED                     __root
     #define RT_USED                     __root
     #define PRAGMA(x)                   _Pragma(#x)
     #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)
         #define va_arg(v,l)             __builtin_va_arg(v,l)
     #endif
     #endif
 
 
-    #define SECTION(x)                  __attribute__((section(x)))
+    #define RT_SECTION(x)               __attribute__((section(x)))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_USED                     __attribute__((used))
     #define RT_USED                     __attribute__((used))
     #define ALIGN(n)                    __attribute__((aligned(n)))
     #define ALIGN(n)                    __attribute__((aligned(n)))
@@ -163,7 +163,7 @@ typedef rt_base_t                       rt_off_t;       /**< Type for offset */
     #define RTT_API
     #define RTT_API
 #elif defined (__ADSPBLACKFIN__)        /* for VisualDSP++ Compiler */
 #elif defined (__ADSPBLACKFIN__)        /* for VisualDSP++ Compiler */
     #include <stdarg.h>
     #include <stdarg.h>
-    #define SECTION(x)                  __attribute__((section(x)))
+    #define RT_SECTION(x)               __attribute__((section(x)))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_UNUSED                   __attribute__((unused))
     #define RT_USED                     __attribute__((used))
     #define RT_USED                     __attribute__((used))
     #define ALIGN(n)                    __attribute__((aligned(n)))
     #define ALIGN(n)                    __attribute__((aligned(n)))
@@ -172,7 +172,7 @@ typedef rt_base_t                       rt_off_t;       /**< Type for offset */
     #define RTT_API
     #define RTT_API
 #elif defined (_MSC_VER)
 #elif defined (_MSC_VER)
     #include <stdarg.h>
     #include <stdarg.h>
-    #define SECTION(x)
+    #define RT_SECTION(x)
     #define RT_UNUSED
     #define RT_UNUSED
     #define RT_USED
     #define RT_USED
     #define ALIGN(n)                    __declspec(align(n))
     #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
     /* 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
      * GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
      * details. */
      * details. */
-    #define SECTION(x)
+    #define RT_SECTION(x)
     #define RT_UNUSED
     #define RT_UNUSED
     #define RT_USED
     #define RT_USED
     #define PRAGMA(x)                   _Pragma(#x)
     #define PRAGMA(x)                   _Pragma(#x)
@@ -195,7 +195,7 @@ typedef rt_base_t                       rt_off_t;       /**< Type for offset */
 #elif defined (__TASKING__)
 #elif defined (__TASKING__)
 
 
     #include <stdarg.h>
     #include <stdarg.h>
-    #define SECTION(x)
+    #define RT_SECTION(x)
     #define RT_UNUSED
     #define RT_UNUSED
     #define RT_USED
     #define RT_USED
     #define PRAGMA(x)                   _Pragma(#x)
     #define PRAGMA(x)                   _Pragma(#x)
@@ -222,11 +222,11 @@ typedef int (*init_fn_t)(void);
         };
         };
         #define INIT_EXPORT(fn, level)                                                       \
         #define INIT_EXPORT(fn, level)                                                       \
             const char __rti_##fn##_name[] = #fn;                                            \
             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};
             { __rti_##fn##_name, fn};
     #else
     #else
         #define INIT_EXPORT(fn, level)                                                       \
         #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
 #endif
 #endif
 #else
 #else

+ 2 - 2
include/rtm.h

@@ -28,8 +28,8 @@ __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs
 
 
 #else
 #else
 #define RTM_EXPORT(symbol)                                            \
 #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,                                                  \
     (void *)&symbol,                                                  \
     __rtmsym_##symbol##_name                                          \
     __rtmsym_##symbol##_name                                          \