summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorLim-LinYuanbo <[email protected]>2021-09-08 22:45:31 +0800
committerGitHub <[email protected]>2021-09-08 22:45:31 +0800
commitb404f69f851817c62697074ffb363294b91585c6 (patch)
treef5f31152993843a5e07559a6b7b0caddcc9ebd0a /components/libc/compilers
parent49fcf9f4cd436d30d2df8c4e24b751194c32f43b (diff)
parent7fa1c819ee852937705d948a58f0218c422ea6b1 (diff)
Merge branch 'master' into master
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/armlibc/syscalls.c2
-rw-r--r--components/libc/compilers/common/dirent.h23
2 files changed, 15 insertions, 10 deletions
diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c
index ce4c358993..be6041a663 100644
--- a/components/libc/compilers/armlibc/syscalls.c
+++ b/components/libc/compilers/armlibc/syscalls.c
@@ -302,7 +302,7 @@ int remove(const char *filename)
#endif
}
-#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) && defined(RT_USING_MODULE) && defined(RT_USING_DFS)
+#if defined(RT_USING_FINSH) && defined(RT_USING_MODULE) && defined(RT_USING_DFS)
/* use system(const char *string) implementation in the msh */
#else
int system(const char *string)
diff --git a/components/libc/compilers/common/dirent.h b/components/libc/compilers/common/dirent.h
index bfba586093..a6353fd6f8 100644
--- a/components/libc/compilers/common/dirent.h
+++ b/components/libc/compilers/common/dirent.h
@@ -6,10 +6,14 @@
* Change Logs:
* Date Author Notes
*/
-#ifndef __RTT_DIRENT_H__
-#define __RTT_DIRENT_H__
+#ifndef __DIRENT_H__
+#define __DIRENT_H__
-#include <rtthread.h>
+#include <rtdef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* dirent.h - format of directory entries
@@ -26,27 +30,28 @@
#define DT_REG 0x01
#define DT_DIR 0x02
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef HAVE_DIR_STRUCTURE
+#define HAVE_DIR_STRUCTURE
typedef struct
{
int fd; /* directory file */
char buf[512];
int num;
int cur;
-} DIR;
+}DIR;
#endif
#ifndef HAVE_DIRENT_STRUCTURE
+#define HAVE_DIRENT_STRUCTURE
+
+#define DIRENT_NAME_MAX 256
+
struct dirent
{
rt_uint8_t d_type; /* The type of the file */
rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */
rt_uint16_t d_reclen; /* length of this record */
- char d_name[256]; /* The null-terminated file name */
+ char d_name[DIRENT_NAME_MAX]; /* The null-terminated file name */
};
#endif