summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-09-21 20:05:35 +0000
committerwm4 <wm4@nowhere>2020-04-23 13:58:16 +0200
commit9cbacefbb03bd7758d35d52a0a3106069db308ea (patch)
tree59b355a9cf464c0640adf0b0ec672df39c3eb303 /osdep
parentca83080fff503ab0c05b9059ce5f293af8d0858d (diff)
downloadmpv-9cbacefbb03bd7758d35d52a0a3106069db308ea.tar.bz2
mpv-9cbacefbb03bd7758d35d52a0a3106069db308ea.tar.xz
build: restore BSD thread names after 9f461b85bfa3
On FreeBSD non-POSIX threading functions are in a separate header. DragonFly and OpenBSD adopted FreeBSD header and extensions. ../test.c:3:3: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration] { pthread_set_name_np(pthread_self(), "ducks"); return 0; } ^ ../osdep/threads.c:47:5: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_set_name_np(pthread_self(), tname); ^ Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
Diffstat (limited to 'osdep')
-rw-r--r--osdep/threads.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/osdep/threads.c b/osdep/threads.c
index 5b164c5179..17642a3f89 100644
--- a/osdep/threads.c
+++ b/osdep/threads.c
@@ -24,6 +24,10 @@
#include "threads.h"
#include "timer.h"
+#if HAVE_BSD_THREAD_NAME
+#include <pthread_np.h>
+#endif
+
int mpthread_mutex_init_recursive(pthread_mutex_t *mutex)
{
pthread_mutexattr_t attr;