block: Workaround for older versions of MinGW gcc
PATCH 1/1 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.
---
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(-)
block/win32-aio.c +5 -5
@@ -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 ) {
Signature · 1 line
1.7.10.4
Quoted 10 lines · 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 <[email protected]>---
Quoted 8 lines
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(-)
Kevin Wolf
AppliedAm 05.11.2012 06:57, schrieb Stefan Hajnoczi:
Quoted 14 lines · Stefan Weil
Quoted 13 lines
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 <[email protected]>---
This patch is needed for Debian's amd64-mingw32msvc-gcc-4.4.4 which I use for MinGW-w64 cross compilation.
Quoted 7 lines
Quoted 5 lines
Regards
Stefan W.block/win32-aio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)Reviewed-by Stefan Hajnoczi <[email protected]>
Thanks, applied to the block branch.
Kevin