-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix: 在没有定义FINSH_USING_SYMTAB时编译报错以及IPC及finsh启用时自动选择必要的功能 #10667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,17 +37,18 @@ static int msh_help(int argc, char **argv) | |
| rt_kprintf("RT-Thread shell commands:\n"); | ||
| { | ||
| struct finsh_syscall *index; | ||
|
|
||
| #if defined(FINSH_USING_SYMTAB) | ||
| for (index = _syscall_table_begin; | ||
| index < _syscall_table_end; | ||
| FINSH_NEXT_SYSCALL(index)) | ||
| { | ||
| #if defined(FINSH_USING_DESCRIPTION) && defined(FINSH_USING_SYMTAB) | ||
| #if defined(FINSH_USING_DESCRIPTION) | ||
| rt_kprintf("%-16s - %s\n", index->name, index->desc); | ||
| #else | ||
| rt_kprintf("%s ", index->name); | ||
| #endif | ||
| #endif /* FINSH_USING_DESCRIPTION */ | ||
| } | ||
| #endif /* FINSH_USING_SYMTAB */ | ||
|
Comment on lines
+40
to
+51
|
||
| } | ||
| rt_kprintf("\n"); | ||
|
|
||
|
|
@@ -231,7 +232,7 @@ static cmd_function_t msh_get_cmd(char *cmd, int size) | |
| { | ||
| struct finsh_syscall *index; | ||
| cmd_function_t cmd_func = RT_NULL; | ||
|
|
||
| #if defined(FINSH_USING_SYMTAB) | ||
| for (index = _syscall_table_begin; | ||
| index < _syscall_table_end; | ||
| FINSH_NEXT_SYSCALL(index)) | ||
|
|
@@ -243,7 +244,7 @@ static cmd_function_t msh_get_cmd(char *cmd, int size) | |
| break; | ||
| } | ||
| } | ||
|
|
||
| #endif /* FINSH_USING_SYMTAB */ | ||
| return cmd_func; | ||
| } | ||
|
|
||
|
|
@@ -814,7 +815,7 @@ void msh_auto_complete(char *prefix) | |
| #endif /* RT_USING_MODULE */ | ||
| } | ||
| #endif /* DFS_USING_POSIX */ | ||
|
|
||
| #if defined(FINSH_USING_SYMTAB) | ||
| /* checks in internal command */ | ||
| { | ||
| for (index = _syscall_table_begin; index < _syscall_table_end; FINSH_NEXT_SYSCALL(index)) | ||
|
|
@@ -839,7 +840,7 @@ void msh_auto_complete(char *prefix) | |
| } | ||
| } | ||
| } | ||
|
|
||
| #endif /* FINSH_USING_SYMTAB */ | ||
| /* auto complete string */ | ||
| if (name_ptr != NULL) | ||
| { | ||
|
|
@@ -866,7 +867,7 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str) | |
| { | ||
| len = strlen(opt_str); | ||
| } | ||
|
|
||
| #if defined(FINSH_USING_SYMTAB) | ||
| for (index = _syscall_table_begin; | ||
| index < _syscall_table_end; | ||
| FINSH_NEXT_SYSCALL(index)) | ||
|
|
@@ -877,7 +878,7 @@ static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str) | |
| break; | ||
| } | ||
| } | ||
|
|
||
| #endif /* FINSH_USING_SYMTAB */ | ||
| return opt; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[documentation/文档]: Empty macro definition lacks explanatory comment.
English: The empty macro definition should include a comment explaining why it's empty and its purpose when FINSH_USING_SYMTAB is not defined. This helps maintainers understand the design decision.
中文:空宏定义缺少解释性注释。应该包含注释说明为什么在未定义 FINSH_USING_SYMTAB 时该宏为空,以及其设计目的。这有助于维护者理解设计决策。