Skip to content

Commit

Permalink
ensure _GNU_SOURCE is defined when including pthread
Browse files Browse the repository at this point in the history
so we can have pthread_setname_np. hopefully.
  • Loading branch information
timo committed Jul 16, 2020
1 parent 2a3290d commit 183becd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/moar.h
Expand Up @@ -13,6 +13,14 @@
/* platform-specific setjmp override */
#include <platform/setjmp.h>

/* 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 <pthread.h>
#endif

/* libuv
* must precede atomic_ops.h so we get the ordering of Winapi headers right
*/
Expand Down

0 comments on commit 183becd

Please sign in to comment.