qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Workaround for older versions of MinGW gcc
@ 2012-11-04 11:09 Stefan Weil
  2012-11-05  5:57 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2012-11-04 11:09 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, Stefan Weil

Versions before gcc-4.6 don't support unnamed fields in initializers
(see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676).

Offset and OffsetHigh belong to an unnamed struct which is part of an
unnamed union. Therefore the original code does not work with older
versions of gcc.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

This patch is needed for Debian's amd64-mingw32msvc-gcc-4.4.4
which I use for MinGW-w64 cross compilation.

Regards
Stefan W.

 block/win32-aio.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/win32-aio.c b/block/win32-aio.c
index c34dc73..92f25a9 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -167,11 +167,11 @@ BlockDriverAIOCB *win32_aio_submit(BlockDriverState *bs,
         waiocb->is_linear = true;
     }
 
-    waiocb->ov = (OVERLAPPED) {
-        .Offset = (DWORD) offset,
-        .OffsetHigh = (DWORD) (offset >> 32),
-        .hEvent = event_notifier_get_handle(&aio->e)
-    };
+    memset(&waiocb->ov, 0, sizeof(waiocb->ov));
+    waiocb->ov.Offset = (DWORD)offset;
+    waiocb->ov.OffsetHigh = (DWORD)(offset >> 32);
+    waiocb->ov.hEvent = event_notifier_get_handle(&aio->e);
+
     aio->count++;
 
     if (type & QEMU_AIO_READ) {
-- 
1.7.10.4

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] block: Workaround for older versions of MinGW gcc
  2012-11-04 11:09 [Qemu-devel] [PATCH] block: Workaround for older versions of MinGW gcc Stefan Weil
@ 2012-11-05  5:57 ` Stefan Hajnoczi
  2012-11-12 10:06   ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2012-11-05  5:57 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, Kevin Wolf, qemu-devel, Paolo Bonzini

On Sun, Nov 04, 2012 at 12:09:34PM +0100, Stefan Weil wrote:
> Versions before gcc-4.6 don't support unnamed fields in initializers
> (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676).
> 
> Offset and OffsetHigh belong to an unnamed struct which is part of an
> unnamed union. Therefore the original code does not work with older
> versions of gcc.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> 
> This patch is needed for Debian's amd64-mingw32msvc-gcc-4.4.4
> which I use for MinGW-w64 cross compilation.
> 
> Regards
> Stefan W.
> 
>  block/win32-aio.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] block: Workaround for older versions of MinGW gcc
  2012-11-05  5:57 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2012-11-12 10:06   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2012-11-12 10:06 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Stefan Weil, qemu-devel, Paolo Bonzini

Am 05.11.2012 06:57, schrieb Stefan Hajnoczi:
> On Sun, Nov 04, 2012 at 12:09:34PM +0100, Stefan Weil wrote:
>> Versions before gcc-4.6 don't support unnamed fields in initializers
>> (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676).
>>
>> Offset and OffsetHigh belong to an unnamed struct which is part of an
>> unnamed union. Therefore the original code does not work with older
>> versions of gcc.
>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>
>> This patch is needed for Debian's amd64-mingw32msvc-gcc-4.4.4
>> which I use for MinGW-w64 cross compilation.
>>
>> Regards
>> Stefan W.
>>
>>  block/win32-aio.c |   10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied to the block branch.

Kevin

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

end of thread, other threads:[~2012-11-12 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-04 11:09 [Qemu-devel] [PATCH] block: Workaround for older versions of MinGW gcc Stefan Weil
2012-11-05  5:57 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-11-12 10:06   ` Kevin Wolf

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).