Skip to content

Commit

Permalink
Fixes #9873. Minor header/api changes for Windows compile of multicas…
Browse files Browse the repository at this point in the history
…t socket to succeed.
  • Loading branch information
daniel-kristjansson committed Jun 27, 2011
1 parent e25a351 commit bd5dbc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions mythtv/libs/libmythupnp/mmulticastsocketdevice.cpp
Expand Up @@ -115,9 +115,7 @@ qint64 MMulticastSocketDevice::writeBlock(
if (addr == "127.0.0.1")
continue; // skip localhost address

struct in_addr interface_addr;
inet_pton(AF_INET, addr.toAscii().constData(),
(char*)&interface_addr);
uint32_t interface_addr = (*it).toIPv4Address();
setsockopt(socket(), IPPROTO_IP, IP_MULTICAST_IF,
&interface_addr, sizeof(interface_addr));
retx = MSocketDevice::writeBlock(data, len, host, port);
Expand Down
10 changes: 7 additions & 3 deletions mythtv/libs/libmythupnp/mmulticastsocketdevice.h
Expand Up @@ -24,9 +24,13 @@
#ifndef _MULTICAST_SOCKET_DEVICE_H_
#define _MULTICAST_SOCKET_DEVICE_H_

#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#ifdef _WIN32
# include <ws2tcpip.h>
#else
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/ip.h>
#endif

// Qt headers
#include <QNetworkInterface>
Expand Down

0 comments on commit bd5dbc4

Please sign in to comment.