Make sim build compilable under Cygwin. Fixes FS#11832.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28899 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2010-12-25 22:17:02 +00:00
parent 5c48232e45
commit 992f897440

View file

@ -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))
{