Skip to content

Commit a92da64

Browse files
committed
BF: CS-1036: Fix compile issues for macOS
1 parent 781ba6a commit a92da64

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

source/libs/cull/pack.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# include <rpc/xdr.h>
4747
#endif
4848

49-
#if defined(SOLARIS)
49+
#if defined(SOLARIS) || defined(DARWIN)
5050
#define htobe64(x) htonll(x)
5151
#define be64toh(x) ntohll(x)
5252
#endif

source/libs/uti/ocs_cond.cc

+4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ namespace ocs::uti {
4040
int condition_initialize(pthread_cond_t *condition) {
4141
int ret{0};
4242

43+
#ifdef DARWIN
44+
ret = pthread_cond_init(condition, nullptr);
45+
#else
4346
pthread_condattr_t attr;
4447
pthread_condattr_init(&attr);
4548
pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
4649

4750
ret = pthread_cond_init(condition, &attr);
51+
#endif
4852

4953
return ret;
5054
}

test/misc/test_cond_timedwait.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ long get_milli() {
3232
}
3333

3434
int main(int argc, const char *argv[]) {
35+
#ifndef DARWIN
3536
#if defined(SOLARIS)
3637
const int num_clocks = 3;
3738
int clock_ids[num_clocks] = {CLOCK_VIRTUAL, CLOCK_REALTIME, CLOCK_MONOTONIC};
@@ -99,6 +100,6 @@ int main(int argc, const char *argv[]) {
99100
pthread_cond_destroy(&condition);
100101
pthread_mutex_destroy(&mutex);
101102
}
102-
103+
#endif
103104
return 0;
104105
}

0 commit comments

Comments
 (0)