summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/dir.h18
-rw-r--r--firmware/common/file.h7
2 files changed, 20 insertions, 5 deletions
diff --git a/firmware/common/dir.h b/firmware/common/dir.h
index 0e0dbfb..622af11 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 c608fbc..dde78bc 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 <io.h>
+#include <stdio.h>
+#endif
+#endif
#endif