From f9c1aedd3dabda8bdd3a95bf821c980aa56e12ed Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 27 Jul 2026 15:12:39 +0000 Subject: [PATCH 8/8] render: handle Darwin's single-argument pthread_setname_np() Darwin's pthread_setname_np() takes only a name and can only name the calling thread, unlike Linux/glibc's (thread, name) form. Same pattern already used for FreeBSD/DragonFly (pthread_set_name_np) and NetBSD (extra format-string argument) above it; the only call site always passes pthread_self(), so dropping the thread argument here is safe. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01U6fuL1PtRJHhr97gAGyS1h --- render.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/render.c b/render.c index 96cfdf84..18887efc 100644 --- a/render.c +++ b/render.c @@ -17,6 +17,15 @@ #define pthread_setname_np(thread, name) (pthread_set_name_np(thread, name), 0) #elif defined(__NetBSD__) #define pthread_setname_np(thread, name) pthread_setname_np(thread, "%s", (void *)name) +#elif defined(__APPLE__) + /* + * Darwin's pthread_setname_np() takes only a name, and can only + * name the calling thread -- unlike Linux/glibc's (thread, name) + * form, which can name any thread. The only call site always names + * the calling thread (pthread_self()), so dropping the first + * argument here is safe. + */ + #define pthread_setname_np(thread, name) pthread_setname_np(name) #endif #include -- 2.43.0