From 12d67134919031aa78b60b194ade40f07ba3718b Mon Sep 17 00:00:00 2001 From: Srivats P Date: Mon, 10 Dec 2018 18:00:00 +0530 Subject: [PATCH] Fix MacOS build break due to missing SA_SIZE definition --- server/bsdhostdevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/bsdhostdevice.cpp b/server/bsdhostdevice.cpp index 34ff67c..e4d49b1 100644 --- a/server/bsdhostdevice.cpp +++ b/server/bsdhostdevice.cpp @@ -36,6 +36,13 @@ along with this program. If not, see #include #include +#ifndef SA_SIZE // For some reason MacOS doesn't define this while BSD does +#define SA_SIZE(sa) \ + ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ + sizeof(long) : \ + 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) +#endif + // FIXME: also defined in emuldevice.cpp - move to common .h static const quint64 kBcastMac = 0xffffffffffffULL; static const quint16 kEthTypeArp = 0x0806;