Merge pull request #3949 from andresag01/dirent-from-c

Fix C declaration of dir functions and types
pull/4020/head
Anna Bridge 2017-03-23 15:41:58 +00:00 committed by GitHub
commit 2fb65e7bd9
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 #if __cplusplus
namespace mbed { class Dir; } namespace mbed { class Dir; }
typedef mbed::Dir DIR; typedef mbed::Dir DIR;
#else
typedef struct Dir DIR;
#endif
#if __cplusplus
extern "C" { extern "C" {
#endif
DIR *opendir(const char*); DIR *opendir(const char*);
struct dirent *readdir(DIR *); struct dirent *readdir(DIR *);
int closedir(DIR*); int closedir(DIR*);
@ -59,6 +64,7 @@ extern "C" {
long telldir(DIR*); long telldir(DIR*);
void seekdir(DIR*, long); void seekdir(DIR*, long);
int mkdir(const char *name, mode_t n); int mkdir(const char *name, mode_t n);
#if __cplusplus
}; };
#endif #endif