diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-12-25 22:17:02 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-12-25 22:17:02 +0000 |
| commit | 992f897440702639115128a08ceaf893df1316ac (patch) | |
| tree | b148a84faab1c6493a2ef0ce05f511a9a1086fb6 | |
| parent | 5c48232e456db3d31e3d657e6b2031c71378b396 (diff) | |
| download | rockbox-992f897440702639115128a08ceaf893df1316ac.zip rockbox-992f897440702639115128a08ceaf893df1316ac.tar.gz rockbox-992f897440702639115128a08ceaf893df1316ac.tar.bz2 rockbox-992f897440702639115128a08ceaf893df1316ac.tar.xz | |
Make sim build compilable under Cygwin. Fixes FS#11832.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28899 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | uisimulator/common/io.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 56abf4b..f77180d 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c @@ -309,6 +309,14 @@ MYDIR *sim_opendir(const char *name) return (MYDIR *)0; } +#if defined(WIN32) +static inline struct tm* localtime_r (const time_t *clock, struct tm *result) { + if (!clock || !result) return NULL; + memcpy(result,localtime(clock),sizeof(*result)); + return result; +} +#endif + struct sim_dirent *sim_readdir(MYDIR *dir) { char buffer[MAX_PATH]; /* sufficiently big */ @@ -346,7 +354,7 @@ struct sim_dirent *sim_readdir(MYDIR *dir) (tm.tm_min << 5) | (tm.tm_sec >> 1); -#ifdef HAVE_LSTAT +#if HAVE_LSTAT #define ATTR_LINK 0x80 if (!lstat(buffer, &s) && S_ISLNK(s.st_mode)) { |