From 9455c92712057c549e37fe12ee0f1bee1a3edab7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 11 Aug 2020 22:37:46 +0200 Subject: [PATCH] Handle broken inet_ntop on old Windows SDKs. --- common/TracySocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 0ec66207..ade450fe 100644 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -566,8 +566,10 @@ IpAddress::~IpAddress() void IpAddress::Set( const struct sockaddr& addr ) { -#if __MINGW32__ - auto ai = (struct sockaddr_in*)&addr; +#if defined _WIN32 && ( !defined NTDDI_WIN10 || NTDDI_VERSION < NTDDI_WIN10 ) + struct sockaddr_in tmp; + memcpy( &tmp, &addr, sizeof( tmp ) ); + auto ai = &tmp; #else auto ai = (const struct sockaddr_in*)&addr; #endif