diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 0e04b794e975553d8a4357b171f14c1496da836c..a97ef3caab2ee89d0b0971db08fefab0cb0b3fea 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -28,6 +28,9 @@ */ #include + +#ifdef RT_USING_FINSH + #include "finsh.h" long hello(void) @@ -831,3 +834,6 @@ void list_prefix(char *prefix) static int dummy = 0; FINSH_VAR_EXPORT(dummy, finsh_type_int, dummy variable for finsh) #endif + +#endif /* RT_USING_FINSH */ + diff --git a/components/finsh/msh.c b/components/finsh/msh.c index ae5214cc2cc6f82426214be1939cc25bf9f46ad2..fd1ee1198d8d3428d9496b9a230da4eee588bef8 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -9,6 +9,9 @@ * 2014-01-03 Bernard msh can execute module. * 2017-07-19 Aubr.Cool limit argc to RT_FINSH_ARG_MAX */ +#include + +#ifdef FINSH_USING_MSH #include "msh.h" #include @@ -610,3 +613,4 @@ void msh_auto_complete(char *prefix) } #endif +#endif /* FINSH_USING_MSH */ diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index 8f5de3cc16558dd5ea60e6b1c64a23c17439aa4c..3c90542456faa5f45d499085abe3747d8c42d90e 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -10,11 +10,12 @@ */ #include -#include +#ifdef FINSH_USING_MSH + +#include #include "msh.h" -#ifdef FINSH_USING_MSH #ifdef RT_USING_DFS #include @@ -418,5 +419,4 @@ int cmd_free(int argc, char **argv) FINSH_FUNCTION_EXPORT_ALIAS(cmd_free, __cmd_free, Show the memory usage in the system.); #endif -#endif - +#endif /* FINSH_USING_MSH */ diff --git a/components/finsh/msh_file.c b/components/finsh/msh_file.c index ecab250859827dfa4efe8256258049e679d8862a..d8eec0a71a1a1a3c69ae063636364ab91fc6b90d 100644 --- a/components/finsh/msh_file.c +++ b/components/finsh/msh_file.c @@ -9,11 +9,11 @@ */ #include -#include - -#include "msh.h" #if defined(FINSH_USING_MSH) && defined(RT_USING_DFS) + +#include +#include "msh.h" #include static int msh_readline(int fd, char *line_buf, int size) @@ -137,4 +137,5 @@ int msh_exec_script(const char *cmd_line, int size) return ret; } -#endif +#endif /* defined(FINSH_USING_MSH) && defined(RT_USING_DFS) */ + diff --git a/components/finsh/shell.c b/components/finsh/shell.c index e4b27004d5c0f195b2c5ceb6ab2d46160249bff7..f96e1f89281d4384431583976ea754daa1acbcad 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -20,6 +20,8 @@ #include +#ifdef RT_USING_FINSH + #include "finsh.h" #include "shell.h" @@ -847,3 +849,6 @@ int finsh_system_init(void) return 0; } INIT_APP_EXPORT(finsh_system_init); + +#endif /* RT_USING_FINSH */ + diff --git a/components/finsh/symbol.c b/components/finsh/symbol.c index a8c64dfdd5e2067ac2f56790e29bad853e2e4c5d..e500637bdde08ce756b907c62bc143c593b31787 100644 --- a/components/finsh/symbol.c +++ b/components/finsh/symbol.c @@ -7,6 +7,11 @@ * Date Author Notes * 2010-03-22 Bernard first version */ + +#include + +#ifdef RT_USING_FINSH + #include "finsh.h" long hello(void); @@ -63,3 +68,6 @@ struct finsh_syscall *_syscall_table_end = &_syscall_table[sizeof(_syscall_tab struct finsh_sysvar *_sysvar_table_begin = NULL; struct finsh_sysvar *_sysvar_table_end = NULL; #endif + +#endif /* RT_USING_FINSH */ +