Fix compilation on Travis (I hope)

This commit is contained in:
Kovid Goyal
2018-03-03 10:56:07 +05:30
parent f8e6f87984
commit a571821f73

View File

@@ -6,17 +6,15 @@
#pragma once
#ifdef __APPLE__
#include <stdio.h>
#include <pthread.h>
#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 <pthread.h>
#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 <stdio.h>
static inline void
set_thread_name(const char *name) {