diff options
Diffstat (limited to 'hw/m48t59.c')
-rw-r--r-- | hw/m48t59.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/m48t59.c b/hw/m48t59.c index 62cd301..9f0a128 100644 --- a/hw/m48t59.c +++ b/hw/m48t59.c @@ -68,7 +68,11 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm) time_t t; t = time(NULL) + NVRAM->time_offset; - localtime_r(&t, tm); +#ifdef _WIN32 + memcpy(tm,localtime(&t),sizeof(*tm)); +#else + localtime_r (&t, tm) ; +#endif } static void set_time (m48t59_t *NVRAM, struct tm *tm) @@ -130,7 +134,11 @@ static void alarm_cb (void *opaque) static void get_alarm (m48t59_t *NVRAM, struct tm *tm) { - localtime_r(&NVRAM->alarm, tm); +#ifdef _WIN32 + memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm)); +#else + localtime_r (&NVRAM->alarm, tm); +#endif } static void set_alarm (m48t59_t *NVRAM, struct tm *tm) |