Fix macOS compile issues

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
pull/2530/head
Kai Buschulte 3 years ago committed by =
parent 7e4746aac4
commit a3125934dd

@ -21,6 +21,7 @@ Contributors:
#ifdef __APPLE__ #ifdef __APPLE__
#include <mach/mach.h> #include <mach/mach.h>
#include <mach/mach_time.h> #include <mach/mach_time.h>
#include <sys/time.h>
#endif #endif
#ifdef WIN32 #ifdef WIN32

@ -197,7 +197,9 @@ static int bridge__set_tcp_keepalive(struct mosquitto *context)
#else #else
ret = ret =
setsockopt(context->sock, SOL_SOCKET, SO_KEEPALIVE, (const void*)&enabled, sizeof(enabled)) || setsockopt(context->sock, SOL_SOCKET, SO_KEEPALIVE, (const void*)&enabled, sizeof(enabled)) ||
#ifndef __APPLE__
setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPIDLE, (const void*)&idle, sizeof(idle)) || setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPIDLE, (const void*)&idle, sizeof(idle)) ||
#endif
setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPINTVL, (const void*)&interval, sizeof(interval)) || setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPINTVL, (const void*)&interval, sizeof(interval)) ||
setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPCNT, (const void*)&counter, sizeof(counter)); setsockopt(context->sock, IPPROTO_TCP, TCP_KEEPCNT, (const void*)&counter, sizeof(counter));
#endif #endif

@ -20,6 +20,9 @@ Contributors:
#include <assert.h> #include <assert.h>
#include <time.h> #include <time.h>
#ifdef __APPLE__
#include <sys/socket.h>
#endif
#include "mosquitto_broker_internal.h" #include "mosquitto_broker_internal.h"
#include "alias_mosq.h" #include "alias_mosq.h"
@ -318,4 +321,3 @@ void context__remove_from_by_id(struct mosquitto *context)
context->in_by_id = false; context->in_by_id = false;
} }
} }

Loading…
Cancel
Save