mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 00:07:59 +02:00
exclude NetworkInterface where not supported
Exclude NetworkInterface and MulticastSocket on platforms where we do not have network interface detection implemented
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
|
||||
|
||||
#include "Poco/Net/MulticastSocket.h"
|
||||
|
||||
|
||||
#ifdef POCO_NET_HAS_INTERFACE
|
||||
|
||||
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include <cstring>
|
||||
|
||||
@@ -263,3 +268,6 @@ void MulticastSocket::leaveGroup(const IPAddress& groupAddress, const NetworkInt
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
|
||||
#endif // POCO_NET_HAS_INTERFACE
|
||||
|
@@ -35,6 +35,11 @@
|
||||
|
||||
|
||||
#include "Poco/Net/NetworkInterface.h"
|
||||
|
||||
|
||||
#ifdef POCO_NET_HAS_INTERFACE
|
||||
|
||||
|
||||
#include "Poco/Net/DatagramSocket.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
@@ -949,7 +954,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
|
||||
pAddress = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(memory.begin()); // leave in the loop, begin may change after resize
|
||||
poco_assert (memory.capacity() >= outBufLen);
|
||||
if (ERROR_BUFFER_OVERFLOW == (dwRetVal = GetAdaptersAddresses(family, flags, 0, pAddress, &outBufLen)))
|
||||
memory.resize(outBufLen); // adjust size and try again
|
||||
memory.resize(outBufLen, false); // adjust size and try again
|
||||
else if (ERROR_NO_DATA == dwRetVal) // no network interfaces found
|
||||
return result;
|
||||
else if (NO_ERROR != dwRetVal) // error occurred
|
||||
@@ -1540,3 +1545,6 @@ NetworkInterface::NetworkInterfaceList NetworkInterface::list()
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // POCO_NET_HAS_INTERFACE
|
||||
|
Reference in New Issue
Block a user