Make pthread_setname_np optional for older glibc.

This commit is contained in:
Johns 2011-12-31 17:28:58 +01:00
parent 0c7170989d
commit c8c760a069
3 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,7 @@ VERSION = $(shell grep 'static const char \*const VERSION *=' $(PLUGIN).cpp | aw
### Configuration (edit this for your needs) ### Configuration (edit this for your needs)
CONFIG := #-DDEBUG CONFIG := #-DDEBUG
#CONFIG += -DHAVE_PTHREAD_NAME
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI") CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU") CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")

View File

@ -48,6 +48,10 @@
#define __USE_GNU #define __USE_GNU
#endif #endif
#include <pthread.h> #include <pthread.h>
#ifndef HAVE_PTHREAD_NAME
/// only available with newer glibc
#define pthread_setname_np(thread, name)
#endif
#endif #endif
#include "ringbuffer.h" #include "ringbuffer.h"

View File

@ -68,6 +68,10 @@
#endif #endif
#include <pthread.h> #include <pthread.h>
#include <time.h> #include <time.h>
#ifndef HAVE_PTHREAD_NAME
/// only available with newer glibc
#define pthread_setname_np(thread, name)
#endif
#endif #endif
#ifdef USE_XLIB_XCB #ifdef USE_XLIB_XCB