meson: fix check for pthread_setname_np()

Need to define _GNU_SOURCE.

Fixes #1542

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

View file

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