Skip to content

Commit b9b338c

Browse files
committed
remove last few __LP64__ usage
This cleans up the __LP64__ usage to allow libdispatch to work correctly on LLP64 targets (like Windows x64).
1 parent 25cbddc commit b9b338c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/allocator_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
// Use the largest type your platform is comfortable doing atomic ops with.
9898
// TODO: rdar://11477843
9999
typedef unsigned long bitmap_t;
100-
#if defined(__LP64__)
100+
#if DISPATCH_SIZEOF_PTR == 8
101101
#define BYTES_PER_BITMAP 8
102102
#else
103103
#define BYTES_PER_BITMAP 4
@@ -147,7 +147,7 @@ typedef unsigned long bitmap_t;
147147

148148
#define PADDING_TO_CONTINUATION_SIZE(x) (ROUND_UP_TO_CONTINUATION_SIZE(x) - (x))
149149

150-
#if defined(__LP64__)
150+
#if DISPATCH_SIZEOF_PTR == 8
151151
#define SIZEOF_HEADER 16
152152
#else
153153
#define SIZEOF_HEADER 8

src/inline_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ _dispatch_queue_drain_try_lock_wlh(dispatch_queue_t dq, uint64_t *dq_state)
12061206
if (unlikely(!_dq_state_is_base_wlh(old_state) ||
12071207
!_dq_state_is_enqueued_on_target(old_state) ||
12081208
_dq_state_is_enqueued_on_manager(old_state))) {
1209-
#if !__LP64__
1209+
#if DISPATCH_SIZEOF_PTR == 4
12101210
old_state >>= 32;
12111211
#endif
12121212
DISPATCH_INTERNAL_CRASH(old_state, "Invalid wlh state");

src/queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ _dispatch_queue_destroy(dispatch_queue_t dq, bool *allow_free)
15471547
DISPATCH_CLIENT_CRASH((uintptr_t)dq_state,
15481548
"Release of a locked queue");
15491549
}
1550-
#ifndef __LP64__
1550+
#if DISPATCH_SIZEOF_PTR == 4
15511551
dq_state >>= 32;
15521552
#endif
15531553
DISPATCH_CLIENT_CRASH((uintptr_t)dq_state,

src/queue_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ dispatch_queue_attr_t _dispatch_get_default_queue_attr(void);
749749
// If dc_flags is less than 0x1000, then the object is a continuation.
750750
// Otherwise, the object has a private layout and memory management rules. The
751751
// layout until after 'do_next' must align with normal objects.
752-
#if __LP64__
752+
#if DISPATCH_SIZEOF_PTR == 8
753753
#define DISPATCH_CONTINUATION_HEADER(x) \
754754
union { \
755755
const void *do_vtable; \

0 commit comments

Comments
 (0)