Skip to content

Commit a21d179

Browse files
committed
linux build fixes
Signed-off-by: Daniel A. Steffen <[email protected]>
1 parent 8f53fb3 commit a21d179

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void _dispatch_log(const char *msg, ...);
454454
* For reporting bugs within libdispatch when using the "_debug" version of the
455455
* library.
456456
*/
457-
#if __GNUC__
457+
#if __APPLE__
458458
#define dispatch_assert(e) do { \
459459
if (__builtin_constant_p(e)) { \
460460
dispatch_static_assert(e); \
@@ -472,7 +472,7 @@ static inline void _dispatch_assert(long e, long line) {
472472
#define dispatch_assert(e) _dispatch_assert((long)(e), __LINE__)
473473
#endif /* __GNUC__ */
474474

475-
#if __GNUC__
475+
#if __APPLE__
476476
/*
477477
* A lot of API return zero upon success and not-zero on fail. Let's capture
478478
* and log the non-zero value
@@ -491,7 +491,7 @@ static inline void _dispatch_assert(long e, long line) {
491491
static inline void _dispatch_assert_zero(long e, long line) {
492492
if (DISPATCH_DEBUG && e) _dispatch_abort(line, e);
493493
}
494-
#define dispatch_assert_zero(e) _dispatch_assert((long)(e), __LINE__)
494+
#define dispatch_assert_zero(e) _dispatch_assert_zero((long)(e), __LINE__)
495495
#endif /* __GNUC__ */
496496

497497
/*

src/queue.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4523,10 +4523,12 @@ _dispatch_return_to_kernel(void)
45234523
void
45244524
_dispatch_poll_for_events_4launchd(void)
45254525
{
4526+
#if DISPATCH_USE_KEVENT_WORKQUEUE
45264527
if (_dispatch_get_wlh()) {
45274528
dispatch_assert(_dispatch_deferred_items_get()->ddi_wlh_servicing);
45284529
_dispatch_event_loop_drain(KEVENT_FLAG_IMMEDIATE);
45294530
}
4531+
#endif
45304532
}
45314533

45324534
#if HAVE_PTHREAD_WORKQUEUE_NARROWING

src/shims/lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,9 @@ _dispatch_gate_wait_slow(dispatch_gate_t dgl, dispatch_lock value,
601601
#if HAVE_UL_UNFAIR_LOCK
602602
_dispatch_unfair_lock_wait(&dgl->dgl_lock, new_value, 0, flags);
603603
#elif HAVE_FUTEX
604-
_dispatch_futex_wait(&dgl->dgl_lock, tid_new, NULL, FUTEX_PRIVATE_FLAG);
604+
_dispatch_futex_wait(&dgl->dgl_lock, new_value, NULL, FUTEX_PRIVATE_FLAG);
605605
#else
606-
_dispatch_thread_switch(tid_new, flags, timeout++);
606+
_dispatch_thread_switch(new_value, flags, timeout++);
607607
#endif
608608
(void)timeout;
609609
}

0 commit comments

Comments
 (0)