From 0196c0c45bd7835a2dbc2bc3e075382e3cf3cba4 Mon Sep 17 00:00:00 2001 From: Felix Arends Date: Sun, 28 Apr 2002 19:29:57 +0000 Subject: [PATCH] added win32 simulator compability git-svn-id: svn://svn.rockbox.org/rockbox/trunk@303 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/dir.h | 18 ++++++++++++++---- firmware/common/file.h | 7 ++++++- 2 files changed, 20 insertions(+), 5 deletions(-) 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