Module: xenomai-3
Branch: stable-3.0.x
Commit: 11e484e70119a99d3f394c7e3f4630e4b4fda36e
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=11e484e70119a99d3f394c7e3f4630e4b4fda36e

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Jan 15 09:28:02 2016 +0100

boilerplate/libc: fix detection of mutex protocols

---

 configure.ac               |    5 +++++
 include/boilerplate/libc.h |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 21c5b96..20fa0ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -519,6 +519,11 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol      \
                shm_unlink])
 LIBS="$save_LIBS"
 
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+AC_CHECK_DECLS([PTHREAD_PRIO_NONE], [], [], [#include <pthread.h>])
+CPPFLAGS=$save_CPPFLAGS
+
 dnl If we can't set the clock for condvar timeouts, then
 dnl we have to restrict the Copperplate clock to CLOCK_REALTIME over
 dnl Mercury unconditionally. Cobalt is different: although we may not
diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h
index f544ef4..0e51b86 100644
--- a/include/boilerplate/libc.h
+++ b/include/boilerplate/libc.h
@@ -31,13 +31,13 @@
 #include <errno.h>
 #include <boilerplate/compiler.h>
 
-#if defined(__UCLIBC__) && !defined(UCLIBC_HAS_THREADS_NATIVE)
+#if !HAVE_DECL_PTHREAD_PRIO_NONE
 enum {
        PTHREAD_PRIO_NONE,
        PTHREAD_PRIO_INHERIT,
        PTHREAD_PRIO_PROTECT
 };
-#endif /* __UCLIBC__  && !UCLIBC_HAS_THREADS_NATIVE */
+#endif /* !HAVE_DECL_PTHREAD_PRIO_NONE */
 
 #ifndef HAVE_FORK
 static inline int fork(void)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to