Skip to content

Commit 698220e

Browse files
authored
Merge pull request #341 from compnerd/llp64
dispatch: adjust for LLP64 environments
2 parents fdd671d + cf5be67 commit 698220e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dispatch/once.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ __BEGIN_DECLS
3838
* Note: static and global variables default to zero.
3939
*/
4040
DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
41-
typedef long dispatch_once_t;
41+
typedef intptr_t dispatch_once_t;
4242

4343
#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__)
4444
#define DISPATCH_ONCE_INLINE_FASTPATH 1

src/source.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ _dispatch_source_handler_free(dispatch_source_t ds, long kind)
300300

301301
DISPATCH_ALWAYS_INLINE
302302
static inline void
303-
_dispatch_source_handler_replace(dispatch_source_t ds, long kind,
303+
_dispatch_source_handler_replace(dispatch_source_t ds, uintptr_t kind,
304304
dispatch_continuation_t dc)
305305
{
306306
if (!dc->dc_func) {
@@ -321,14 +321,14 @@ _dispatch_source_set_handler_slow(void *context)
321321
dispatch_assert(dx_type(ds) == DISPATCH_SOURCE_KEVENT_TYPE);
322322

323323
dispatch_continuation_t dc = context;
324-
long kind = (long)dc->dc_data;
324+
void *kind = dc->dc_data;
325325
dc->dc_data = NULL;
326-
_dispatch_source_handler_replace(ds, kind, dc);
326+
_dispatch_source_handler_replace(ds, (uintptr_t)kind, dc);
327327
}
328328

329329
DISPATCH_NOINLINE
330330
static void
331-
_dispatch_source_set_handler(dispatch_source_t ds, long kind,
331+
_dispatch_source_set_handler(dispatch_source_t ds, uintptr_t kind,
332332
dispatch_continuation_t dc)
333333
{
334334
dispatch_assert(dx_type(ds) == DISPATCH_SOURCE_KEVENT_TYPE);

0 commit comments

Comments
 (0)