Skip to content

Commit

Permalink
Fix compilation on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
SimulPiscator committed Nov 8, 2023
1 parent f51fb4f commit 3b6d69c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zeroconf/networkhotplugnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <vector>
#include <thread>

#if !__APPLE__
#include <poll.h>
#include <unistd.h>
#include <netinet/in.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#endif // !__APPLE__

struct NetworkHotplugNotifier::Private
{
Expand Down Expand Up @@ -59,6 +61,7 @@ struct NetworkHotplugNotifier::Private

void hotplugThread()
{
#if !__APPLE__
int sock = ::socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sock < 0) {
std::cerr << "Could not create netlink socket: " << errno << std::endl;
Expand Down Expand Up @@ -103,6 +106,7 @@ struct NetworkHotplugNotifier::Private
}
}
}
#endif // !__APPLE__
}
};

Expand Down

0 comments on commit 3b6d69c

Please sign in to comment.