Commit 4bd2c750 authored by Max Kellermann's avatar Max Kellermann

thread/Name: disable pthread_setname_np() on NetBSD

NetBSD's pthread_setname_np() prototype is incompatible with the rest of the world, and it requires to pass the string argument as a non-const pointer. Instead of working around this misdesign, I hereby disable the feature on NetBSD.
parent b9ed850b
...@@ -5,6 +5,7 @@ ver 0.19.8 (not yet released) ...@@ -5,6 +5,7 @@ ver 0.19.8 (not yet released)
- dsdiff, dsf: allow ID3 tags larger than 4 kB - dsdiff, dsf: allow ID3 tags larger than 4 kB
- ffmpeg: support interleaved floating point - ffmpeg: support interleaved floating point
* fix clang 3.6 warnings * fix clang 3.6 warnings
* fix build failure on NetBSD
ver 0.19.7 (2014/12/17) ver 0.19.7 (2014/12/17)
* input * input
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef MPD_THREAD_NAME_HXX #ifndef MPD_THREAD_NAME_HXX
#define MPD_THREAD_NAME_HXX #define MPD_THREAD_NAME_HXX
#ifdef HAVE_PTHREAD_SETNAME_NP #if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__NetBSD__)
# define HAVE_THREAD_NAME # define HAVE_THREAD_NAME
# include <pthread.h> # include <pthread.h>
# include <stdio.h> # include <stdio.h>
...@@ -34,7 +34,11 @@ ...@@ -34,7 +34,11 @@
static inline void static inline void
SetThreadName(const char *name) SetThreadName(const char *name)
{ {
#ifdef HAVE_PTHREAD_SETNAME_NP #if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__NetBSD__)
/* not using pthread_setname_np() on NetBSD because it
requires a non-const pointer argument, which we don't have
here */
#ifdef __APPLE__ #ifdef __APPLE__
pthread_setname_np(name); pthread_setname_np(name);
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment