diff --git a/firmware/common/dir.h b/firmware/common/dir.h index 0e0dbfb4b5..622af11f6d 100644 --- a/firmware/common/dir.h +++ b/firmware/common/dir.h @@ -20,16 +20,26 @@ #ifndef _DIR_H_ #define _DIR_H_ -typdef struct { - int offset; -} DIR; - struct dirent { unsigned char d_name[256]; int attribute; int size; }; +#ifndef SIMULATOR +typedef struct { + int offset; +} DIR; +#else // SIMULATOR +#ifdef _WIN32 +typedef struct DIRtag +{ + struct dirent fd; + intptr_t handle; +} DIR; +#endif // _WIN32 +#endif // SIMULATOR + extern DIR* opendir(char* name); extern int closedir(DIR* dir); diff --git a/firmware/common/file.h b/firmware/common/file.h index c608fbc6a0..dde78bc17d 100644 --- a/firmware/common/file.h +++ b/firmware/common/file.h @@ -32,9 +32,14 @@ extern int read(int fd, void* buf, int count); extern int write(int fd, void* buf, int count); extern int lseek(int fd, int offset, int whence); -#endif extern int remove(char* pathname); extern int rename(char* oldname, char* newname); +#else +#ifdef _WIN32 +#include +#include +#endif +#endif #endif