qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] No localtime_r in windows
@ 2008-04-15 21:20 consul
  2008-04-17  0:30 ` andrzej zaborowski
  0 siblings, 1 reply; 2+ messages in thread
From: consul @ 2008-04-15 21:20 UTC (permalink / raw)
  To: qemu-devel

I don't pretend it is the correct patch, but at least it fixes the compile 
time error on windows and seems to work. I'm not sure if the thread-safety 
mechanism is needed here, or if this is the proper place to define the 
function.

Alex.

$ svn diff hw/twl92230.c
Index: hw/twl92230.c
===================================================================
--- hw/twl92230.c       (revision 4215)
+++ hw/twl92230.c       (working copy)
@@ -29,6 +29,14 @@

 #define VERBOSE 1

+#ifdef _WIN32
+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 menelaus_s {
     i2c_slave i2c;
     qemu_irq irq;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-17  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 21:20 [Qemu-devel] No localtime_r in windows consul
2008-04-17  0:30 ` andrzej zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).