All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] posix: Avoid double declarations
Date: Tue, 14 Apr 2009 18:11:56 +0200	[thread overview]
Message-ID: <49E4B5CC.1050902@domain.hid> (raw)

Please pull from git://git.xenomai.org/xenomai-jki.git for-upstream
and run bootstrap.

---------->

Recent glibc versions come with support for
pthread_mutexattr_get/setprotocol and pthread_condattr_get/setclock.
Make sure we don't declare those prototypes in Xenomai's pthread.h a
second time as this can cause g++ warnings and even errors.

Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---

 configure.in            |    4 ++--
 include/posix/pthread.h |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index b291ce4..6a8b821 100644
--- a/configure.in
+++ b/configure.in
@@ -750,8 +750,8 @@ if test x$CONFIG_XENO_POSIX_UITRON_MLOCKALL = xy; then
 fi
 
 save_LIBS="$LIBS"
-LIBS="$LIBS -lrt"
-AC_CHECK_FUNCS([shm_open shm_unlink mmap64 ftruncate64])
+LIBS="$LIBS -lrt -lpthread"
+AC_CHECK_FUNCS([shm_open shm_unlink mmap64 ftruncate64 pthread_mutexattr_setprotocol pthread_condattr_setclock])
 LIBS="$save_LIBS"
 
 AC_MSG_CHECKING(whether to enable dlopen support for skin libraries)
diff --git a/include/posix/pthread.h b/include/posix/pthread.h
index 2344158..98db325 100644
--- a/include/posix/pthread.h
+++ b/include/posix/pthread.h
@@ -418,17 +418,21 @@ int pthread_intr_control_np(pthread_intr_t intr,
 extern "C" {
 #endif
 
+#ifndef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
 				  int *proto);
 
 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
 				  int proto);
+#endif
 
+#ifndef HAVE_PTHREAD_CONDATTR_SETCLOCK
 int pthread_condattr_getclock(const pthread_condattr_t *attr,
 			      clockid_t *clk_id);
 
 int pthread_condattr_setclock(pthread_condattr_t *attr,
 			      clockid_t clk_id);
+#endif
 
 int pthread_make_periodic_np(pthread_t thread,
 			     struct timespec *starttp,


             reply	other threads:[~2009-04-14 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 16:11 Jan Kiszka [this message]
2009-04-14 16:22 ` [Xenomai-core] [PATCH] posix: Avoid double declarations Gilles Chanteperdrix
2009-04-14 16:32   ` Jan Kiszka
2009-04-14 16:43     ` Gilles Chanteperdrix
2009-04-14 16:50       ` Jan Kiszka
2009-04-14 16:54         ` Gilles Chanteperdrix
2009-04-14 17:00           ` Jan Kiszka
2009-04-14 17:23             ` Gilles Chanteperdrix
2009-04-14 16:24 ` Gilles Chanteperdrix
2009-04-14 16:29   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E4B5CC.1050902@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.