summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-01-23 16:38:46 +0100
committerMichael Stahl <mstahl@redhat.com>2015-01-26 10:54:15 +0000
commitc106f83da16726506962e19bcbc3d4c25415b81a (patch)
tree51f9e4d2b7b445e8f9dc53171d72cd6673e1a9b9 /sd
parentd6587d789ac67daa94677670c6e3a001e45c139d (diff)
sal,sd: Windows SDK 8.1 deprecates inet_addr()
Change-Id: I443f73fab48f1b66b38e2c77af0fe89f99ee4cd0 Reviewed-on: https://gerrit.libreoffice.org/14142 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 04ef5e7282b7..5cd9907ca4e3 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -122,7 +122,18 @@ void DiscoveryService::setupSockets()
struct ip_mreq multicastRequest;
+// the Win32 SDK 8.1 deprecates inet_addr()
+#ifdef _WIN32_WINNT_WINBLUE
+ IN_ADDR addr;
+ OUString const saddr("239.0.0.1");
+ INT ret = InetPtonW(AF_INET, saddr.getStr(), & addr);
+ if (1 == ret)
+ {
+ multicastRequest.imr_multiaddr.s_addr = addr.S_un.S_addr;
+ }
+#else
multicastRequest.imr_multiaddr.s_addr = inet_addr( "239.0.0.1" );
+#endif
multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY);
rc = setsockopt( mSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,