Commit d157e205e94931f5870b1b3bf2b1f149a87c5aa7

Authored by bellard
1 parent 5f21aef2

win32 fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@833 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 2 deletions
hw/m48t59.c
@@ -68,7 +68,11 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm) @@ -68,7 +68,11 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm)
68 time_t t; 68 time_t t;
69 69
70 t = time(NULL) + NVRAM->time_offset; 70 t = time(NULL) + NVRAM->time_offset;
71 - localtime_r(&t, tm); 71 +#ifdef _WIN32
  72 + memcpy(tm,localtime(&t),sizeof(*tm));
  73 +#else
  74 + localtime_r (&t, tm) ;
  75 +#endif
72 } 76 }
73 77
74 static void set_time (m48t59_t *NVRAM, struct tm *tm) 78 static void set_time (m48t59_t *NVRAM, struct tm *tm)
@@ -130,7 +134,11 @@ static void alarm_cb (void *opaque) @@ -130,7 +134,11 @@ static void alarm_cb (void *opaque)
130 134
131 static void get_alarm (m48t59_t *NVRAM, struct tm *tm) 135 static void get_alarm (m48t59_t *NVRAM, struct tm *tm)
132 { 136 {
133 - localtime_r(&NVRAM->alarm, tm); 137 +#ifdef _WIN32
  138 + memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm));
  139 +#else
  140 + localtime_r (&NVRAM->alarm, tm);
  141 +#endif
134 } 142 }
135 143
136 static void set_alarm (m48t59_t *NVRAM, struct tm *tm) 144 static void set_alarm (m48t59_t *NVRAM, struct tm *tm)