* [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
* Re: [Qemu-devel] No localtime_r in windows
2008-04-15 21:20 [Qemu-devel] No localtime_r in windows consul
@ 2008-04-17 0:30 ` andrzej zaborowski
0 siblings, 0 replies; 2+ messages in thread
From: andrzej zaborowski @ 2008-04-17 0:30 UTC (permalink / raw)
To: qemu-devel
Hi,
On 15/04/2008, consul <void@aleksoft.net> wrote:
> 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.
Thanks for spotting that (also thanks to Herve Poussineau). I
converted the TWL92230 RTC to use qemu's own time/date functions and
there should be no localtime_r uses left there.
Regards
--
Please do not print this email unless absolutely necessary. Spread
environmental awareness.
^ 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).