From 9feba93b6692da35300324acf7d57af185bbb836 Mon Sep 17 00:00:00 2001 From: Aaron Dierking Date: Mon, 15 Oct 2018 16:37:42 -0700 Subject: [PATCH] Fix the signature of _dispatch_install_thread_detach_callback() This function is declared as accepting a `dispatch_function_t` callback, which is a function pointer with a `void *` argument. However, the implementation and Swift overlay declare the callback without arguments, causing a conflict which Clang warns about. Change the function signature to accept the correct type. --- private/queue_private.h | 2 +- src/queue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/private/queue_private.h b/private/queue_private.h index f71e5e37f..b7ab515a4 100644 --- a/private/queue_private.h +++ b/private/queue_private.h @@ -342,7 +342,7 @@ dispatch_async_enforce_qos_class_f(dispatch_queue_t queue, * "detached" before the thread exits or the application will crash. */ DISPATCH_EXPORT -void _dispatch_install_thread_detach_callback(dispatch_function_t cb); +void _dispatch_install_thread_detach_callback(void (*cb)(void)); #endif __END_DECLS diff --git a/src/queue.c b/src/queue.c index 6c7593fca..b2e1f916b 100644 --- a/src/queue.c +++ b/src/queue.c @@ -953,7 +953,7 @@ gettid(void) static void (*_dispatch_thread_detach_callback)(void); void -_dispatch_install_thread_detach_callback(dispatch_function_t cb) +_dispatch_install_thread_detach_callback(void (*cb)(void)) { if (os_atomic_xchg(&_dispatch_thread_detach_callback, cb, relaxed)) { DISPATCH_CLIENT_CRASH(0, "Installing a thread detach callback twice");