diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2021-04-09 15:22:22 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2021-04-09 15:43:37 +0000 |
commit | 9f8421af637942e5d9963828f4ce55f456410603 (patch) | |
tree | 5130c1d89a5c2782b3949fd3b68d26991bbb9755 /include | |
parent | 38e875904b039ec1889e7c81eb1d577a4f69b26d (diff) |
meson: check pthread_setname_np like autotools
FreeBSD < 12.2 and OpenBSD only have pthread_set_name_np.
As libpthread isn't in scope use -Werror to trip the check.
Header <pthread.h> has symbol "PTHREAD_MUTEX_RECURSIVE" : YES
Checking if "pthread_setname_np(tid, name)" compiles: YES
os/inputthread.c:326:5: error: implicit declaration of function 'pthread_setname_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pthread_setname_np (pthread_self(), "InputThread");
^
os/inputthread.c:447:5: error: implicit declaration of function 'pthread_setname_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pthread_setname_np (pthread_self(), "MainThread");
^
Fixes: c20e7b5e2222 ("meson: Automatically detect HAVE_PTHREAD_SETNAME_NP")
Diffstat (limited to 'include')
-rw-r--r-- | include/meson.build | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/meson.build b/include/meson.build index b92796f31..d9ab76941 100644 --- a/include/meson.build +++ b/include/meson.build @@ -67,6 +67,7 @@ if cc.compiles(''' #include <pthread.h> void foo(int bar) { pthread_setname_np(pthread_self(), "example"); } ''', + args: '-Werror-implicit-function-declaration', name: 'pthread_setname_np(tid, name)') conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITH_TID', 1) elif cc.compiles(''' @@ -74,6 +75,7 @@ elif cc.compiles(''' #include <pthread.h> void foo(int bar) { pthread_setname_np("example"); } ''', + args: '-Werror-implicit-function-declaration', name: 'pthread_setname_np(name)') conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', 1) endif |