diff --git a/kitty/threading.h b/kitty/threading.h index 3d6d8894d..6aa518c37 100644 --- a/kitty/threading.h +++ b/kitty/threading.h @@ -6,17 +6,15 @@ #pragma once -#ifdef __APPLE__ +#include #include +#ifdef __APPLE__ // I cant figure out how to get pthread.h to include this definition on macOS. MACOSX_DEPLOYMENT_TARGET does not work. extern int pthread_setname_np(const char *name); #else -// Need _GNU_SOURCE for pthread_setname_np on linux -#define _GNU_SOURCE -#include -#undef _GNU_SOURCE +// 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); #endif -#include static inline void set_thread_name(const char *name) {