winrt: Fix build for Windows Kit 10.0.10586.0

The old SDK does not consider the macro value a constant expression, so
the build fails.

Change-Id: I95bdcd9ad34ee4da81016ff07e70439ed229f853
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
Oliver Wolff 2017-06-19 14:30:19 +02:00 committed by Simon Hausmann
parent dcaa2d057b
commit fdbf400b27

View File

@ -251,17 +251,16 @@ public:
{ {
HRESULT hr = action->GetResults(); HRESULT hr = action->GetResults();
if (FAILED(hr)) { if (FAILED(hr)) {
switch (hr) { if (hr == HRESULT_FROM_WIN32(WSAETIMEDOUT)) {
case HRESULT_FROM_WIN32(WSAETIMEDOUT):
emit connectOpFinished(false, QAbstractSocket::NetworkError, WinRTSocketEngine::ConnectionTimeOutErrorString); emit connectOpFinished(false, QAbstractSocket::NetworkError, WinRTSocketEngine::ConnectionTimeOutErrorString);
return S_OK; return S_OK;
case HRESULT_FROM_WIN32(WSAEHOSTUNREACH): } else if (hr == HRESULT_FROM_WIN32(WSAEHOSTUNREACH)) {
emit connectOpFinished(false, QAbstractSocket::HostNotFoundError, WinRTSocketEngine::HostUnreachableErrorString); emit connectOpFinished(false, QAbstractSocket::HostNotFoundError, WinRTSocketEngine::HostUnreachableErrorString);
return S_OK; return S_OK;
case HRESULT_FROM_WIN32(WSAECONNREFUSED): } else if (hr == HRESULT_FROM_WIN32(WSAECONNREFUSED)) {
emit connectOpFinished(false, QAbstractSocket::ConnectionRefusedError, WinRTSocketEngine::ConnectionRefusedErrorString); emit connectOpFinished(false, QAbstractSocket::ConnectionRefusedError, WinRTSocketEngine::ConnectionRefusedErrorString);
return S_OK; return S_OK;
default: } else {
emit connectOpFinished(false, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString); emit connectOpFinished(false, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
return S_OK; return S_OK;
} }