From eb1a8d72feccd5fb2f15c96ef1d032627ce9b12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Wed, 10 Apr 2019 18:11:27 +0200 Subject: [PATCH] Haiku doesn't support pthread_set_name_np yet --- src/calibre/utils/speedup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/speedup.c b/src/calibre/utils/speedup.c index 1d3d5763db..d270f3678c 100644 --- a/src/calibre/utils/speedup.c +++ b/src/calibre/utils/speedup.c @@ -504,6 +504,8 @@ extern int pthread_setname_np(const char *name); void pthread_set_name_np(pthread_t tid, const char *name); #elif defined(__NetBSD__) // pthread.h provides the symbol +#elif defined(__HAIKU__) +// Haiku doesn't support pthread_set_name_np yet #else // Need _GNU_SOURCE for pthread_setname_np on linux and that causes other issues on systems with old glibc extern int pthread_setname_np(pthread_t, const char *name); @@ -514,8 +516,8 @@ extern int pthread_setname_np(pthread_t, const char *name); static PyObject* set_thread_name(PyObject *self, PyObject *args) { (void)(self); (void)(args); -#if defined(_MSC_VER) - PyErr_SetString(PyExc_RuntimeError, "Setting thread names not supported on Windows"); +#if defined(_MSC_VER) || defined(__HAIKU__) + PyErr_SetString(PyExc_RuntimeError, "Setting thread names not supported on on this platform"); return NULL; #else char *name;