summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2018-11-07 14:31:32 +0800
committer[email protected] <[email protected]>2018-11-07 14:31:32 +0800
commit931cdb1f6f844810c4bc58f8e3f0f19e031b8e20 (patch)
tree971787ccc01a58f60b3513eda4b6df848287dc79 /components
parentddd7343b0c7a87b40dcd4f99e15922aa97ea5595 (diff)
[finsh/shell] compatible definition for cube package
Diffstat (limited to 'components')
-rw-r--r--components/finsh/cmd.c6
-rw-r--r--components/finsh/msh.c4
-rw-r--r--components/finsh/msh_cmd.c8
-rw-r--r--components/finsh/msh_file.c9
-rw-r--r--components/finsh/shell.c5
-rw-r--r--components/finsh/symbol.c8
6 files changed, 32 insertions, 8 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c
index 0e04b794e9..a97ef3caab 100644
--- a/components/finsh/cmd.c
+++ b/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 */
+
diff --git a/components/finsh/msh.c b/components/finsh/msh.c
index ae5214cc2c..fd1ee1198d 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 <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 */
diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c
index 8f5de3cc16..3c90542456 100644
--- a/components/finsh/msh_cmd.c
+++ b/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 */
diff --git a/components/finsh/msh_file.c b/components/finsh/msh_file.c
index ecab250859..d8eec0a71a 100644
--- a/components/finsh/msh_file.c
+++ b/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) */
+
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index e4b27004d5..f96e1f8928 100644
--- a/components/finsh/shell.c
+++ b/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 */
+
diff --git a/components/finsh/symbol.c b/components/finsh/symbol.c
index a8c64dfdd5..e500637bdd 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 <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 */
+