summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-12-25 22:17:02 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-12-25 22:17:02 +0000
commit992f897440702639115128a08ceaf893df1316ac (patch)
treeb148a84faab1c6493a2ef0ce05f511a9a1086fb6 /uisimulator
parent5c48232e456db3d31e3d657e6b2031c71378b396 (diff)
downloadrockbox-992f897440702639115128a08ceaf893df1316ac.tar.gz
rockbox-992f897440702639115128a08ceaf893df1316ac.tar.bz2
rockbox-992f897440702639115128a08ceaf893df1316ac.zip
Make sim build compilable under Cygwin. Fixes FS#11832.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28899 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/io.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index 56abf4b6ad..f77180dc21 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))
{