From 24b4b6cbb9d4b646ed52f1fc996e90f638a7aba6 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 9 Jun 2021 19:50:03 +0800 Subject: [kernel]补充endif后缀注释 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/components.c') diff --git a/src/components.c b/src/components.c index 9709d0aae2..d684d5e6fd 100644 --- a/src/components.c +++ b/src/components.c @@ -23,11 +23,11 @@ #ifdef RT_USING_USER_MAIN #ifndef RT_MAIN_THREAD_STACK_SIZE #define RT_MAIN_THREAD_STACK_SIZE 2048 -#endif +#endif /* RT_MAIN_THREAD_STACK_SIZE */ #ifndef RT_MAIN_THREAD_PRIORITY #define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3) -#endif -#endif +#endif /* RT_MAIN_THREAD_PRIORITY */ +#endif /* RT_USING_USER_MAIN */ #ifdef RT_USING_COMPONENTS_INIT /* @@ -98,7 +98,7 @@ void rt_components_board_init(void) { (*fn_ptr)(); } -#endif +#endif /* RT_DEBUG_INIT */ } /** @@ -124,9 +124,9 @@ void rt_components_init(void) { (*fn_ptr)(); } -#endif +#endif /* RT_DEBUG_INIT */ } -#endif /* RT_USING_COMPONENTS_INIT */ +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_USER_MAIN @@ -167,7 +167,7 @@ int entry(void) ALIGN(8) static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE]; struct rt_thread main_thread; -#endif +#endif /* RT_USING_HEAP */ /* the system main thread */ void main_thread_entry(void *parameter) @@ -177,11 +177,11 @@ void main_thread_entry(void *parameter) #ifdef RT_USING_COMPONENTS_INIT /* RT-Thread components initialization */ rt_components_init(); -#endif +#endif /* RT_USING_COMPONENTS_INIT */ #ifdef RT_USING_SMP rt_hw_secondary_cpu_up(); -#endif +#endif /* RT_USING_SMP */ /* invoke system main function */ #if defined(__CC_ARM) || defined(__CLANG_ARM) { @@ -211,7 +211,7 @@ void rt_application_init(void) /* if not define RT_USING_HEAP, using to eliminate the warning */ (void)result; -#endif +#endif /* RT_USING_HEAP */ rt_thread_startup(tid); } @@ -237,7 +237,7 @@ int rtthread_startup(void) #ifdef RT_USING_SIGNALS /* signal system initialization */ rt_system_signal_init(); -#endif +#endif /* RT_USING_SIGNALS */ /* create init_thread */ rt_application_init(); @@ -250,7 +250,7 @@ int rtthread_startup(void) #ifdef RT_USING_SMP rt_hw_spin_lock(&_cpus_lock); -#endif /*RT_USING_SMP*/ +#endif /* RT_USING_SMP */ /* start scheduler */ rt_system_scheduler_start(); @@ -258,4 +258,4 @@ int rtthread_startup(void) /* never reach here */ return 0; } -#endif +#endif /* RT_USING_USER_MAIN */ -- cgit v1.3.1 From 921e6064260f7afa80f3d10424bd49526241a3ee Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 13 Jun 2021 17:36:42 +0800 Subject: 将defined(__CC_ARM) || defined(__CLANG_ARM) 改为 ifdef __ARMCC_VERSION MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/finsh/shell.c | 2 +- include/libc/libc_signal.h | 2 +- include/rtlibc.h | 2 +- include/rtthread.h | 2 +- src/components.c | 4 ++-- src/kservice.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/components.c') diff --git a/components/finsh/shell.c b/components/finsh/shell.c index a749660629..c89139c0ed 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -817,7 +817,7 @@ int finsh_system_init(void) rt_thread_t tid; #ifdef FINSH_USING_SYMTAB -#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM C Compiler */ +#ifdef __ARMCC_VERSION /* ARM C Compiler */ extern const int FSymTab$$Base; extern const int FSymTab$$Limit; extern const int VSymTab$$Base; diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 8a4cc0d738..1fb8194643 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -71,7 +71,7 @@ typedef unsigned long sigset_t; #include -#if defined(__CC_ARM) || defined(__CLANG_ARM) +#ifdef __ARMCC_VERSION #define SIGHUP 1 /* #define SIGINT 2 */ diff --git a/include/rtlibc.h b/include/rtlibc.h index a62051e157..4e7caa81fc 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -22,7 +22,7 @@ #include "libc/libc_stdio.h" #ifndef RT_USING_LIBC -#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__) typedef signed long off_t; typedef int mode_t; #endif diff --git a/include/rtthread.h b/include/rtthread.h index ccd2d147a8..cf897b0e5e 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -567,7 +567,7 @@ rt_size_t rt_strlen(const char *src); #endif /*RT_KSERVICE_USING_STDLIB*/ char *rt_strdup(const char *s); -#if defined(__CC_ARM) || defined(__CLANG_ARM) +#ifdef __ARMCC_VERSION /* lack strdup interface */ char* strdup(const char* str); #endif diff --git a/src/components.c b/src/components.c index d684d5e6fd..e156b783e4 100644 --- a/src/components.c +++ b/src/components.c @@ -134,7 +134,7 @@ void rt_application_init(void); void rt_hw_board_init(void); int rtthread_startup(void); -#if defined(__CC_ARM) || defined(__CLANG_ARM) +#ifdef __ARMCC_VERSION extern int $Super$$main(void); /* re-define main function */ int $Sub$$main(void) @@ -183,7 +183,7 @@ void main_thread_entry(void *parameter) rt_hw_secondary_cpu_up(); #endif /* RT_USING_SMP */ /* invoke system main function */ -#if defined(__CC_ARM) || defined(__CLANG_ARM) +#ifdef __ARMCC_VERSION { extern int $Super$$main(void); $Super$$main(); /* for ARMCC. */ diff --git a/src/kservice.c b/src/kservice.c index 448b2d717d..49e1486078 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -532,7 +532,7 @@ char *rt_strdup(const char *s) return tmp; } RTM_EXPORT(rt_strdup); -#if defined(__CC_ARM) || defined(__CLANG_ARM) +#ifdef __ARMCC_VERSION char *strdup(const char *s) __attribute__((alias("rt_strdup"))); #endif #endif /* RT_USING_HEAP */ -- cgit v1.3.1