Browse Source

Merge pull request #1953 from ErnestChen1/master

[finsh/shell] compatible definition for cube package
Bernard Xiong 6 years ago
parent
commit
9d55baa7c6

+ 6 - 0
components/finsh/cmd.c

@@ -28,6 +28,9 @@
  */
 
 #include <rtthread.h>
+
+#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 */
+

+ 4 - 0
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 <rtthread.h>
+
+#ifdef FINSH_USING_MSH
 
 #include "msh.h"
 #include <finsh.h>
@@ -610,3 +613,4 @@ void msh_auto_complete(char *prefix)
 }
 #endif
 
+#endif /* FINSH_USING_MSH */

+ 4 - 4
components/finsh/msh_cmd.c

@@ -10,11 +10,12 @@
  */
 
 #include <rtthread.h>
-#include <finsh.h>
 
+#ifdef FINSH_USING_MSH
+
+#include <finsh.h>
 #include "msh.h"
 
-#ifdef FINSH_USING_MSH
 #ifdef RT_USING_DFS
 #include <dfs_posix.h>
 
@@ -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 */

+ 5 - 4
components/finsh/msh_file.c

@@ -9,11 +9,11 @@
  */
 
 #include <rtthread.h>
-#include <finsh.h>
-
-#include "msh.h"
 
 #if defined(FINSH_USING_MSH) && defined(RT_USING_DFS)
+
+#include <finsh.h>
+#include "msh.h"
 #include <dfs_posix.h>
 
 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) */
+

+ 5 - 0
components/finsh/shell.c

@@ -20,6 +20,8 @@
 
 #include <rthw.h>
 
+#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 */
+

+ 8 - 0
components/finsh/symbol.c

@@ -7,6 +7,11 @@
  * Date           Author       Notes
  * 2010-03-22     Bernard      first version
  */
+ 
+#include <rtthread.h>
+
+#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 */
+