From 046fe00b96be06efc7c903e6a898e9bb0374d0c3 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Thu, 13 Jul 2023 12:13:35 +0800 Subject: [PATCH] nsh_fscmd.c:fix "implicit declaration" warning. Fix error: implicit declaration of function 'nsh_foreach_direntry' [-Werror=implicit-function-declaration] on file nsh_fscmds on some compiler versions. Signed-off-by: chenrun1 --- nshlib/nsh.h | 4 ++-- nshlib/nsh_fscmds.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 40e2bd0e3..9690f38ba 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -571,9 +571,9 @@ # undef NSH_HAVE_READFILE #endif -/* nsh_foreach_direntry used by the ls and ps commands */ +/* nsh_foreach_direntry used by the ls and ps and fdinfo commands */ -#if defined(CONFIG_NSH_DISABLE_LS) && defined(CONFIG_NSH_DISABLE_PS) +#if defined(CONFIG_NSH_DISABLE_LS) && defined(CONFIG_NSH_DISABLE_PS) && defined(CONFIG_NSH_DISABLE_FDINFO) # undef NSH_HAVE_FOREACH_DIRENTRY #endif diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 1874b05d5..62a202e45 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -42,6 +42,8 @@ #include #include +#include "nsh.h" + #if !defined(CONFIG_DISABLE_MOUNTPOINT) # include # include