aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-11-04 12:09:34 +0100
committerKevin Wolf <kwolf@redhat.com>2012-11-14 18:19:21 +0100
commitcee40d2d2dda87fd9705ed4b85e2c0cf0e5c2ac4 (patch)
treec7846b6270773f14873d9bd16b4ad9fbe68fad96 /block
parent54d01a0073db56230815d16cf3e6054c1dba919a (diff)
downloadqemu-cee40d2d2dda87fd9705ed4b85e2c0cf0e5c2ac4.zip
qemu-cee40d2d2dda87fd9705ed4b85e2c0cf0e5c2ac4.tar.gz
qemu-cee40d2d2dda87fd9705ed4b85e2c0cf0e5c2ac4.tar.bz2
block: Workaround for older versions of MinGW gcc
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> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/win32-aio.c10
1 files 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) {