diff --git a/lib/isc/pthreads/include/isc/thread.h b/lib/isc/pthreads/include/isc/thread.h index 66c6e1c439..037a44cf5b 100644 --- a/lib/isc/pthreads/include/isc/thread.h +++ b/lib/isc/pthreads/include/isc/thread.h @@ -52,6 +52,6 @@ isc_thread_setname(isc_thread_t thread, const char *name); isc_result_t isc_thread_setaffinity(int cpu); -#define isc_thread_self (unsigned long)pthread_self +#define isc_thread_self (uintptr_t) pthread_self ISC_LANG_ENDDECLS diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c index f21b4d0526..3441ce5c14 100644 --- a/lib/isc/rwlock.c +++ b/lib/isc/rwlock.c @@ -175,7 +175,7 @@ isc__rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type); static void print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) { fprintf(stderr, - "rwlock %p thread %lu %s(%s): " + "rwlock %p thread %" PRIuPTR " %s(%s): " "write_requests=%u, write_completions=%u, " "cnt_and_flag=0x%x, readers_waiting=%u, " "write_granted=%u, write_quota=%u\n", diff --git a/lib/isc/task.c b/lib/isc/task.c index da0f4d90e5..a618d5b65b 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -61,13 +61,14 @@ */ #ifdef ISC_TASK_TRACE -#define XTRACE(m) \ - fprintf(stderr, "task %p thread %lu: %s\n", task, isc_thread_self(), \ - (m)) -#define XTTRACE(t, m) \ - fprintf(stderr, "task %p thread %lu: %s\n", (t), isc_thread_self(), (m)) +#define XTRACE(m) \ + fprintf(stderr, "task %p thread %" PRIuPTR ": %s\n", task, \ + isc_thread_self(), (m)) +#define XTTRACE(t, m) \ + fprintf(stderr, "task %p thread %" PRIuPTR ": %s\n", (t), \ + isc_thread_self(), (m)) #define XTHREADTRACE(m) \ - fprintf(stderr, "thread %lu: %s\n", isc_thread_self(), (m)) + fprintf(stderr, "thread %" PRIuPTR ": %s\n", isc_thread_self(), (m)) #else /* ifdef ISC_TASK_TRACE */ #define XTRACE(m) #define XTTRACE(t, m) diff --git a/lib/isc/trampoline.c b/lib/isc/trampoline.c index c8ce5a4cad..009e8d136b 100644 --- a/lib/isc/trampoline.c +++ b/lib/isc/trampoline.c @@ -26,7 +26,7 @@ struct isc__trampoline { int tid; /* const */ - isc_thread_t self; + uintptr_t self; isc_threadfunc_t start; isc_threadarg_t arg; }; diff --git a/lib/isc/win32/condition.c b/lib/isc/win32/condition.c index 0f835f97cf..0859ff6fbb 100644 --- a/lib/isc/win32/condition.c +++ b/lib/isc/win32/condition.c @@ -93,7 +93,7 @@ register_thread(unsigned long thrd, isc_condition_t *gblcond, } static isc_result_t -find_thread_condition(unsigned long thrd, isc_condition_t *cond, +find_thread_condition(uintptr_t thrd, isc_condition_t *cond, isc_condition_thread_t **threadcondp) { isc_condition_thread_t *threadcond; diff --git a/lib/isc/win32/include/isc/condition.h b/lib/isc/win32/include/isc/condition.h index 39a1420b18..fc4e96c8f3 100644 --- a/lib/isc/win32/include/isc/condition.h +++ b/lib/isc/win32/include/isc/condition.h @@ -22,8 +22,8 @@ typedef struct isc_condition_thread isc_condition_thread_t; struct isc_condition_thread { - unsigned long th; - HANDLE handle[2]; + uintptr_t th; + HANDLE handle[2]; ISC_LINK(isc_condition_thread_t) link; }; diff --git a/lib/isc/win32/include/isc/thread.h b/lib/isc/win32/include/isc/thread.h index 49776b8daa..1927bda4de 100644 --- a/lib/isc/win32/include/isc/thread.h +++ b/lib/isc/win32/include/isc/thread.h @@ -12,6 +12,7 @@ #ifndef ISC_THREAD_H #define ISC_THREAD_H 1 +#include #include #include @@ -68,7 +69,7 @@ typedef DWORD isc_threadresult_t; typedef void * isc_threadarg_t; typedef isc_threadresult_t(WINAPI *isc_threadfunc_t)(isc_threadarg_t); -#define isc_thread_self (unsigned long)GetCurrentThreadId +#define isc_thread_self (uintptr_t) GetCurrentThreadId ISC_LANG_BEGINDECLS diff --git a/lib/ns/query.c b/lib/ns/query.c index 52e40922c9..96150d29a8 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -161,18 +161,17 @@ client_trace(ns_client_t *client, int level, const char *message) { sizeof(tbuf)); isc_log_write(ns_lctx, NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_QUERY, level, - "query client=%p thread=0x%lx " + "query client=%p thread=0x%" PRIxPTR "(%s/%s): %s", - client, (unsigned long)isc_thread_self(), - qbuf, tbuf, message); + client, isc_thread_self(), qbuf, tbuf, + message); } } else { isc_log_write(ns_lctx, NS_LOGCATEGORY_CLIENT, NS_LOGMODULE_QUERY, level, - "query client=%p thread=0x%lx " + "query client=%p thread=0x%" PRIxPTR "(): %s", - client, (unsigned long)isc_thread_self(), - message); + client, isc_thread_self(), message); } } #define CTRACE(l, m) client_trace(client, l, m)