From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlsaU-0000tT-4v for qemu-devel@nongnu.org; Tue, 15 Apr 2008 17:21:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlsaT-0000tH-Dm for qemu-devel@nongnu.org; Tue, 15 Apr 2008 17:21:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlsaT-0000tE-8Z for qemu-devel@nongnu.org; Tue, 15 Apr 2008 17:21:09 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JlsaS-00066j-Uo for qemu-devel@nongnu.org; Tue, 15 Apr 2008 17:21:09 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JlsaN-0005tE-9C for qemu-devel@nongnu.org; Tue, 15 Apr 2008 21:21:03 +0000 Received: from 204.147.152.1 ([204.147.152.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Apr 2008 21:21:03 +0000 Received: from void by 204.147.152.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Apr 2008 21:21:03 +0000 From: "consul" Date: Tue, 15 Apr 2008 14:20:53 -0700 Message-ID: Sender: news Subject: [Qemu-devel] No localtime_r in windows Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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;