summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Network.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-04-11 01:00:31 +0200
committerJose <jose@zeroc.com>2017-04-11 01:00:31 +0200
commit9b3573c34f05d2d2d92a7e5acd3e970c67ecced0 (patch)
treedd15d242557e3492a0e112d956fed8166192eca1 /cpp/src/Ice/Network.cpp
parentFixed ICE-7755 - listen on all IPs associated with a DNS name (diff)
downloadice-9b3573c34f05d2d2d92a7e5acd3e970c67ecced0.tar.bz2
ice-9b3573c34f05d2d2d92a7e5acd3e970c67ecced0.tar.xz
ice-9b3573c34f05d2d2d92a7e5acd3e970c67ecced0.zip
Fix (ICE-7671) - VS 2017 crash when build UWP
Diffstat (limited to 'cpp/src/Ice/Network.cpp')
-rwxr-xr-xcpp/src/Ice/Network.cpp65
1 files changed, 45 insertions, 20 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index b1c48af121b..a78556b151d 100755
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -854,21 +854,33 @@ IceInternal::NativeInfo::queueAction(SocketOperation op, IAsyncAction^ action, b
action->Completed = ref new AsyncActionCompletedHandler(
[=] (IAsyncAction^ info, Windows::Foundation::AsyncStatus status)
{
- if(status != Windows::Foundation::AsyncStatus::Completed)
- {
- asyncInfo->count = SOCKET_ERROR;
- asyncInfo->error = info->ErrorCode.Value;
- }
- else
- {
- asyncInfo->count = 0;
- }
- completed(op);
+ //
+ // COMPILERFIX with VC141 using operator!= and operator== inside
+ // a lambda callback triggers a compiler bug, we move the code to
+ // a seperate private method to workaround the issue.
+ //
+ this->queueActionCompleted(op, asyncInfo, info, status);
});
}
}
void
+IceInternal::NativeInfo::queueActionCompleted(SocketOperation op, AsyncInfo* asyncInfo, IAsyncAction^ info,
+ Windows::Foundation::AsyncStatus status)
+{
+ if(status != Windows::Foundation::AsyncStatus::Completed)
+ {
+ asyncInfo->count = SOCKET_ERROR;
+ asyncInfo->error = info->ErrorCode.Value;
+ }
+ else
+ {
+ asyncInfo->count = 0;
+ }
+ completed(op);
+}
+
+void
IceInternal::NativeInfo::queueOperation(SocketOperation op, IAsyncOperation<unsigned int>^ operation)
{
AsyncInfo* info = getAsyncInfo(op);
@@ -883,16 +895,12 @@ IceInternal::NativeInfo::queueOperation(SocketOperation op, IAsyncOperation<unsi
info->completedHandler = ref new AsyncOperationCompletedHandler<unsigned int>(
[=] (IAsyncOperation<unsigned int>^ operation, Windows::Foundation::AsyncStatus status)
{
- if(status != Windows::Foundation::AsyncStatus::Completed)
- {
- info->count = SOCKET_ERROR;
- info->error = operation->ErrorCode.Value;
- }
- else
- {
- info->count = static_cast<int>(operation->GetResults());
- }
- completed(op);
+ //
+ // COMPILERFIX with VC141 using operator!= and operator== inside
+ // a lambda callback triggers a compiler bug, we move the code to
+ // a seperate private method to workaround the issue.
+ //
+ this->queueOperationCompleted(op, info, operation, status);
});
}
operation->Completed = info->completedHandler;
@@ -900,6 +908,23 @@ IceInternal::NativeInfo::queueOperation(SocketOperation op, IAsyncOperation<unsi
}
void
+IceInternal::NativeInfo::queueOperationCompleted(SocketOperation op, AsyncInfo* info,
+ IAsyncOperation<unsigned int>^ operation,
+ Windows::Foundation::AsyncStatus status)
+{
+ if(status != Windows::Foundation::AsyncStatus::Completed)
+ {
+ info->count = SOCKET_ERROR;
+ info->error = operation->ErrorCode.Value;
+ }
+ else
+ {
+ info->count = static_cast<int>(operation->GetResults());
+ }
+ completed(op);
+}
+
+void
IceInternal::NativeInfo::setCompletedHandler(SocketOperationCompletedHandler^ handler)
{
_completedHandler = handler;