[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] No localtime_r in windows
From: |
consul |
Subject: |
[Qemu-devel] No localtime_r in windows |
Date: |
Tue, 15 Apr 2008 14:20:53 -0700 |
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;
- [Qemu-devel] No localtime_r in windows,
consul <=