meson: fix check for pthread_setname_np()

Need to define _GNU_SOURCE.

Fixes #1542

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3538>
This commit is contained in:
Tim-Philipp Müller 2022-12-07 11:49:40 +00:00
parent 22c326edea
commit a2c7398a1c

View file

@ -279,7 +279,8 @@ if cc.has_function('localtime_r', prefix : '#include<time.h>')
cdata.set('HAVE_DECL_LOCALTIME_R', 1)
endif
if cc.links('''#include <pthread.h>
if cc.links('''#define _GNU_SOURCE
#include <pthread.h>
int main() {
pthread_setname_np("example"); return 0;
}''', name : 'pthread_setname_np(const char*)')