Module: xenomai-3
Branch: next
Commit: 7ae3277efca6775458c4b4a9d9930bdfbed36b99
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7ae3277efca6775458c4b4a9d9930bdfbed36b99

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 89c2911..c2fafb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -523,6 +523,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