From db8539528b514fb2a70a61f775aba3ed447bbb05 Mon Sep 17 00:00:00 2001 From: Ron Olson Date: Tue, 19 Mar 2019 12:26:28 -0500 Subject: [PATCH 1/2] Added underscores to gettid(void) to remove name clash with system-provided gettid() in /usr/include/bits/unistd_ext.h that is not static --- src/queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/queue.c b/src/queue.c index 83aa8ec20..53b8e4edd 100644 --- a/src/queue.c +++ b/src/queue.c @@ -7272,21 +7272,21 @@ libdispatch_init(void) #ifdef SYS_gettid DISPATCH_ALWAYS_INLINE static inline pid_t -gettid(void) +__gettid(void) { return (pid_t)syscall(SYS_gettid); } #elif defined(__FreeBSD__) DISPATCH_ALWAYS_INLINE static inline pid_t -gettid(void) +__gettid(void) { return (pid_t)pthread_getthreadid_np(); } #elif defined(_WIN32) DISPATCH_ALWAYS_INLINE static inline DWORD -gettid(void) +__gettid(void) { return GetCurrentThreadId(); } @@ -7401,7 +7401,7 @@ libdispatch_tsd_init(void) #else FlsSetValue(__dispatch_tsd_key, &__dispatch_tsd); #endif // defined(_WIN32) - __dispatch_tsd.tid = gettid(); + __dispatch_tsd.tid = __gettid(); } #endif From 7f08ce48d9073e67d2fa5731e40bbfcbdb7a9546 Mon Sep 17 00:00:00 2001 From: Ron Olson Date: Thu, 21 Mar 2019 09:17:17 -0500 Subject: [PATCH 2/2] Changed __gettid() to _gettid() to be consistent with existing naming conventions --- src/queue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/queue.c b/src/queue.c index a483fc17f..44cb6551b 100644 --- a/src/queue.c +++ b/src/queue.c @@ -7300,21 +7300,21 @@ libdispatch_init(void) #ifdef SYS_gettid DISPATCH_ALWAYS_INLINE static inline pid_t -__gettid(void) +_gettid(void) { return (pid_t)syscall(SYS_gettid); } #elif defined(__FreeBSD__) DISPATCH_ALWAYS_INLINE static inline pid_t -__gettid(void) +_gettid(void) { return (pid_t)pthread_getthreadid_np(); } #elif defined(_WIN32) DISPATCH_ALWAYS_INLINE static inline DWORD -__gettid(void) +_gettid(void) { return GetCurrentThreadId(); } @@ -7429,7 +7429,7 @@ libdispatch_tsd_init(void) #else FlsSetValue(__dispatch_tsd_key, &__dispatch_tsd); #endif // defined(_WIN32) - __dispatch_tsd.tid = __gettid(); + __dispatch_tsd.tid = _gettid(); } #endif