* [PATCH] Fix <semaphore.h>
@ 2002-04-02 10:22 Jakub Jelinek
2002-04-02 16:34 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2002-04-02 10:22 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
echo '#include <semaphore.h>' | gcc -std=c99 -xc -
fails because <bits/types.h> has:
/* Now add the thread types. */
#if defined __USE_POSIX199506 || defined __USE_UNIX98
# include <bits/pthreadtypes.h>
#endif
so for ISO C99 _pthread_fastlock is not defined.
Below is one solution (assuming semaphore.h can bring in pthread types),
alternatively something like #ifdef _PTHREAD_FASTLOCK_DEFINED could be
used).
2002-04-02 Jakub Jelinek <jakub@redhat.com>
* semaphore.h: Include bits/pthreadtypes.h.
--- libc/linuxthreads/semaphore.h.jj Mon Jun 25 10:34:10 2001
+++ libc/linuxthreads/semaphore.h Tue Apr 2 20:25:27 2002
@@ -21,6 +21,7 @@
# define __need_timespec
# include <time.h>
#endif
+#include <bits/pthreadtypes.h>
#ifndef _PTHREAD_DESCR_DEFINED
/* Thread descriptors. Needed for `sem_t' definition. */
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix <semaphore.h>
2002-04-02 10:22 [PATCH] Fix <semaphore.h> Jakub Jelinek
@ 2002-04-02 16:34 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2002-04-02 16:34 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Glibc hackers
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
On Tue, 2002-04-02 at 10:22, Jakub Jelinek wrote:
> so for ISO C99 _pthread_fastlock is not defined.
Which is OK since <semaphore.h> is no C99 header. Code which uses the
POSIX header must add the appropriate feature select macros.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-03 0:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-02 10:22 [PATCH] Fix <semaphore.h> Jakub Jelinek
2002-04-02 16:34 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).