From a571821f731f99f706ba24042da9b07721645e85 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 3 Mar 2018 10:56:07 +0530 Subject: [PATCH] Fix compilation on Travis (I hope) --- kitty/threading.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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) {