Fix C declaration of dir functions and types

This patch fixes the declaration of the DIR type and related functions
so that they can be called from C code. This is necessary when enabling
functionality that uses the filesystem in mbed TLS.
pull/3949/head
Andres AG 2017-03-16 13:57:46 +00:00
parent cc58a7fb0c
commit 2d0135632d
1 changed files with 6 additions and 0 deletions

View File

@ -50,8 +50,13 @@ typedef int mode_t; ///< Mode for opening files
#if __cplusplus
namespace mbed { class Dir; }
typedef mbed::Dir DIR;
#else
typedef struct Dir DIR;
#endif
#if __cplusplus
extern "C" {
#endif
DIR *opendir(const char*);
struct dirent *readdir(DIR *);
int closedir(DIR*);
@ -59,6 +64,7 @@ extern "C" {
long telldir(DIR*);
void seekdir(DIR*, long);
int mkdir(const char *name, mode_t n);
#if __cplusplus
};
#endif