Skip to content

Commit 7d74847

Browse files
committed
fixup apple compile errors
1 parent 464312b commit 7d74847

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

anet.c

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575

7676
#include "anet.h"
7777

78+
#define _UNUSED(V) ((void) V)
79+
7880
static void anetSetError(char *err, const char *fmt, ...)
7981
{
8082
va_list ap;
@@ -134,6 +136,7 @@ int anetTcpKeepAlive(char *err, int fd)
134136
int count = 3;
135137

136138
#ifdef __APPLE__
139+
_UNUSED(yes);
137140
if (set_tcp_keepalive(fd, idle, interval, count) == -1) {
138141
anetSetError(err, "setsockopt tcp keepalive: %s", strerror(errno));
139142
return ANET_ERR;

compat/compat.h

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
# define le32toh(x) OSSwapLittleToHostInt32(x)
2222

2323
#include "apple/clock_compat.h"
24-
#include "apple/clock_gettime"
25-
#include "apple/clock_nanosleep"
2624
#include "apple/compat.h"
2725
#include "apple/cpu_compat.h"
2826
#include "apple/epoll_shim.h"

globe_index.c

+2
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ static void mark_legs(traceBuffer tb, struct aircraft *a, int start, int recent)
11251125
int64_t last_low = 0;
11261126

11271127
int last_high_index = 0;
1128+
MODES_NOTUSED(last_high_index);
11281129
int last_low_index = 0;
11291130

11301131
int64_t last_airborne = 0;
@@ -1136,6 +1137,7 @@ static void mark_legs(traceBuffer tb, struct aircraft *a, int start, int recent)
11361137
int last_5min_gap_index = -1;
11371138
struct state last_5min_gap_state = { 0 };
11381139
int last_10min_gap_index = -1;
1140+
MODES_NOTUSED(last_10min_gap_index);
11391141

11401142
int was_ground = 0;
11411143

readsb.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@
9595
#include <zlib.h>
9696
#include <inttypes.h>
9797
#include <sched.h>
98-
#include <sys/epoll.h>
99-
#include <sys/eventfd.h>
10098
#include "minilzo/minilzo.h"
10199
#include "threadpool.h"
102100
#include <stdatomic.h>
103101
#include <zstd.h>
104102
#include <sys/mman.h>
105103

104+
#ifndef __APPLE__
105+
#include <sys/epoll.h>
106+
#include <sys/eventfd.h>
107+
#endif
108+
106109

107110
#include "compat/compat.h"
108111

util.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ void threadTimedWait(threadT *thread, struct timespec *ts, int64_t increment) {
301301
void threadSignalJoin(threadT *thread) {
302302
if (thread->joined)
303303
return;
304-
int64_t timeout = Modes.joinTimeout;
305304
int err = 0;
306305
#ifdef __APPLE__
307306
pthread_join(thread->pthread, NULL);
308307
#else
308+
int64_t timeout = Modes.joinTimeout;
309309
while ((err = pthread_tryjoin_np(thread->pthread, NULL)) && timeout-- > 0) {
310310
pthread_cond_signal(&thread->cond);
311311
msleep(1);

0 commit comments

Comments
 (0)