From: "consul" <void@aleksoft.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] No localtime_r in windows
Date: Tue, 15 Apr 2008 14:20:53 -0700 [thread overview]
Message-ID: <fu367n$ttl$1@ger.gmane.org> (raw)
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;
next reply other threads:[~2008-04-15 21:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-15 21:20 consul [this message]
2008-04-17 0:30 ` [Qemu-devel] No localtime_r in windows andrzej zaborowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='fu367n$ttl$1@ger.gmane.org' \
--to=void@aleksoft.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.