Fixed incompatible types (from 'int *' to 'const char *') warning #2

https://msdn.microsoft.com/en-us/library/windows/desktop/ms738574(v=vs.85).aspx
This commit is contained in:
Nikolay Raspopov 2017-09-18 20:27:10 +03:00 committed by GitHub
parent f7ec37d92f
commit 1ffb2ea580

View File

@ -615,8 +615,13 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
}
if(ipv6) {
#ifdef _WIN32
DWORD mcastHops = ttl;
if(setsockopt(sudp, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (const char *)&mcastHops, sizeof(mcastHops)) < 0)
#else /* _WIN32 */
int mcastHops = ttl;
if(setsockopt(sudp, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &mcastHops, sizeof(mcastHops)) < 0)
#endif /* _WIN32 */
{
PRINT_SOCKET_ERROR("setsockopt(IPV6_MULTICAST_HOPS,...)");
}