Skip to content

Commit 80eedb8

Browse files
committed
[DFS] Update DFS code.
1. Add extern "C" for cplusplus in DFS. 2. Export more symbol in DFS.
1 parent 7962a5c commit 80eedb8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

components/dfs/include/dfs_posix.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#include <dfs_file.h>
3131
#include <dfs_def.h>
3232

33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif
36+
3337
#ifndef RT_USING_NEWLIB
3438
#define O_RDONLY DFS_O_RDONLY
3539
#define O_WRONLY DFS_O_WRONLY
@@ -79,6 +83,7 @@
7983

8084
#if defined(__CC_ARM)
8185
#include <stdio.h>
86+
#include <stdlib.h>
8287
#elif defined(_MSC_VER)
8388
#include <stdio.h>
8489
#else
@@ -126,5 +131,8 @@ int rmdir(const char *path);
126131
int chdir(const char *path);
127132
char *getcwd(char *buf, size_t size);
128133

134+
#ifdef __cplusplus
135+
}
129136
#endif
130137

138+
#endif

components/dfs/src/dfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ const char *dfs_subdir(const char *directory, const char *filename)
284284

285285
return dir;
286286
}
287+
RTM_EXPORT(dfs_subdir);
287288

288289
/**
289290
* this function will normalize a path according to specified parent directory
@@ -410,5 +411,7 @@ char *dfs_normalize_path(const char *directory, const char *filename)
410411

411412
return fullpath;
412413
}
414+
RTM_EXPORT(dfs_normalize_path);
415+
413416
/*@}*/
414417

0 commit comments

Comments
 (0)