From 96361d82c986e65740dd0c6b42cb725c15a17eea Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 21 Nov 2012 21:24:04 +1100 Subject: Fix MinGW compilation for tst_qwinoverlappedionotifier Change-Id: I664761e7e6fd1c00067ae1def496ba4974e539be Reviewed-by: Janne Anttila Reviewed-by: Friedemann Kleint --- .../tst_qwinoverlappedionotifier.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp index 4aee2926d3..c8a7d36196 100644 --- a/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp +++ b/tests/auto/corelib/io/qwinoverlappedionotifier/tst_qwinoverlappedionotifier.cpp @@ -43,6 +43,10 @@ #include #include +#ifndef PIPE_REJECT_REMOTE_CLIENTS +#define PIPE_REJECT_REMOTE_CLIENTS 0x08 +#endif + class tst_QWinOverlappedIoNotifier : public QObject { Q_OBJECT @@ -141,7 +145,8 @@ void tst_QWinOverlappedIoNotifier::readFile() notifier.setHandle(hFile); notifier.setEnabled(true); - OVERLAPPED overlapped = {0}; + OVERLAPPED overlapped; + ZeroMemory(&overlapped, sizeof(OVERLAPPED)); QByteArray buffer(readBufferSize, 0); BOOL readSuccess = ReadFile(hFile, buffer.data(), buffer.size(), NULL, &overlapped); QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING); @@ -175,7 +180,8 @@ void tst_QWinOverlappedIoNotifier::waitForNotified() notifier.setEnabled(true); QCOMPARE(notifier.waitForNotified(100, 0), false); - OVERLAPPED overlapped = {0}; + OVERLAPPED overlapped; + ZeroMemory(&overlapped, sizeof(OVERLAPPED)); QByteArray buffer(readBufferSize, 0); BOOL readSuccess = ReadFile(hFile, buffer.data(), buffer.size(), NULL, &overlapped); QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING); @@ -206,7 +212,8 @@ void tst_QWinOverlappedIoNotifier::brokenPipe() notifier.setHandle(hReadEnd); notifier.setEnabled(true); - OVERLAPPED overlapped = {0}; + OVERLAPPED overlapped; + ZeroMemory(&overlapped, sizeof(OVERLAPPED)); QByteArray buffer(1024, 0); BOOL readSuccess = ReadFile(hReadEnd, buffer.data(), buffer.size(), NULL, &overlapped); QVERIFY(readSuccess || GetLastError() == ERROR_IO_PENDING); -- cgit v1.2.3