Skip to content

Commit 2fb65e7

Browse files
authored
Merge pull request #3949 from andresag01/dirent-from-c
Fix C declaration of dir functions and types
2 parents 2bf9791 + 2d01356 commit 2fb65e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

platform/mbed_retarget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@ typedef int mode_t; ///< Mode for opening files
5050
#if __cplusplus
5151
namespace mbed { class Dir; }
5252
typedef mbed::Dir DIR;
53+
#else
54+
typedef struct Dir DIR;
55+
#endif
5356

57+
#if __cplusplus
5458
extern "C" {
59+
#endif
5560
DIR *opendir(const char*);
5661
struct dirent *readdir(DIR *);
5762
int closedir(DIR*);
5863
void rewinddir(DIR*);
5964
long telldir(DIR*);
6065
void seekdir(DIR*, long);
6166
int mkdir(const char *name, mode_t n);
67+
#if __cplusplus
6268
};
6369
#endif
6470

0 commit comments

Comments
 (0)