Simplify guard against defining pthread types on Cygwin

* libc/include/sys/types.h: Fix a comment about Cygwin.  Simplify
	guarding pthread types against inclusion on Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2016-04-21 10:27:29 +02:00
parent 8cb99e8ba4
commit 878e65d354

View File

@ -240,14 +240,14 @@ typedef __int64_t sbintime_t;
#include <sys/features.h> #include <sys/features.h>
/* Cygwin will probably never have full posix compliance due to little things /*
* like an inability to set the stackaddress. Cygwin is also using void * * Cygwin is using a complete distinct implementation of pthread objects and
* pointers rather than structs to ensure maximum binary compatability with * pointers rather than structs. This means we can't use the types defined
* previous releases. * here, but rather in <machine/types.h>.
* This means that we don't use the types defined here, but rather in
* <machine/types.h>
*/ */
#if defined(_POSIX_THREADS) && !defined(__CYGWIN__) #if !defined(__CYGWIN__)
#if defined(_POSIX_THREADS)
#include <sys/sched.h> #include <sys/sched.h>
@ -430,11 +430,10 @@ typedef struct {
int is_initialized; /* is this structure initialized? */ int is_initialized; /* is this structure initialized? */
int init_executed; /* has the initialization routine been run? */ int init_executed; /* has the initialization routine been run? */
} pthread_once_t; /* dynamic package initialization */ } pthread_once_t; /* dynamic package initialization */
#endif /* defined(_POSIX_THREADS) && !defined(__CYGWIN__) */ #endif /* defined(_POSIX_THREADS) */
/* POSIX Barrier Types */ /* POSIX Barrier Types */
#if !defined(__CYGWIN__)
#if defined(_POSIX_BARRIERS) #if defined(_POSIX_BARRIERS)
typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */ typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */
typedef struct { typedef struct {
@ -462,6 +461,7 @@ typedef struct {
#endif #endif
} pthread_rwlockattr_t; } pthread_rwlockattr_t;
#endif /* defined(_POSIX_READER_WRITER_LOCKS) */ #endif /* defined(_POSIX_READER_WRITER_LOCKS) */
#endif /* __CYGWIN__ */ #endif /* __CYGWIN__ */
#include <machine/types.h> #include <machine/types.h>