meson: fix check for pthread_setname_np()
authorTim-Philipp Müller <tim@centricular.com>
Wed, 7 Dec 2022 11:49:40 +0000 (11:49 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 7 Dec 2022 11:53:50 +0000 (11:53 +0000)
Need to define _GNU_SOURCE.

Fixes #1542

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3538>

subprojects/gstreamer/meson.build

index 765c0b8..0641f76 100644 (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*)')