From 183becd24ec7a62a57601c6038e987d987bc3647 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 16 Jul 2020 16:34:15 +0200 Subject: [PATCH] ensure _GNU_SOURCE is defined when including pthread so we can have pthread_setname_np. hopefully. --- src/moar.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/moar.h b/src/moar.h index c93518626a..3b50db8591 100644 --- a/src/moar.h +++ b/src/moar.h @@ -13,6 +13,14 @@ /* platform-specific setjmp override */ #include +/* If we're building for GLIBC, we need to set _GNU_SOURCE so that + * pthread will export pthread_setname_np for us. + */ +#if (2 < __GLIBC__) || ((2 == __GLIBC__) && (12 <= __GLIBC_MINOR__)) +#define _GNU_SOURCE +#include +#endif + /* libuv * must precede atomic_ops.h so we get the ordering of Winapi headers right */