[PATCH] Fix <semaphore.h>
Jakub Jelinek
jakub@redhat.com
Tue Apr 2 10:22:00 GMT 2002
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
More information about the Libc-hacker
mailing list