]> git.proxmox.com Git - mirror_qemu.git/commitdiff
win32 fix
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 20 May 2004 13:22:36 +0000 (13:22 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 20 May 2004 13:22:36 +0000 (13:22 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@833 c046a42c-6fe2-441c-8c8c-71466251a162

hw/m48t59.c

index 62cd301e50becd9dc9e055807c8de89b85be3547..9f0a128d596c8bdcfe03ec090abb2d5cd614cfa8 100644 (file)
@@ -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)