summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-07-14 09:03:06 +0200
committerNoel Grandin <noel@peralex.com>2014-07-14 11:07:48 +0200
commitc14a3c1de2a093a8cfcb454a5d32c9810820cbd1 (patch)
treec2c0c65c9e6210763876cff0844e81dff3bb4e62 /sal
parent24f28634fa60ed5860edd1728567b7c3e7fa9573 (diff)
workaround hack that trips up externandnotdefined clang plugin
Change-Id: I2f458cbd582c3e7cfe433915483c0b0489467471
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/mutex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sal/osl/unx/mutex.c b/sal/osl/unx/mutex.c
index a8eb99dd7fed..1ee4418cf60f 100644
--- a/sal/osl/unx/mutex.c
+++ b/sal/osl/unx/mutex.c
@@ -25,7 +25,12 @@
#include <pthread.h>
#include <stdlib.h>
-#if defined LINUX /* bad hack */
+/* Bad hack. This function has two problems - on older systems it has a different name,
+ and on some older systems it is not defined in the header file.
+ Unfortunately there is no completely foolproof test, so we're just working around
+ the issue here. The __clang__ test prevents this hack from triggering the check
+ in the externandnotdefined clang plugin. */
+#if defined LINUX && ! defined __clang__
int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int);
#define pthread_mutexattr_settype pthread_mutexattr_setkind_np
#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP