[newlib-cygwin] Simplify guard against defining pthread types on Cygwin

Corinna Vinschen corinna@sourceware.org
Thu Apr 21 08:27:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=878e65d35444595d84fb68df0cdf7af531b5acbf

commit 878e65d35444595d84fb68df0cdf7af531b5acbf
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Apr 21 10:27:29 2016 +0200

    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>

Diff:
---
 newlib/libc/include/sys/types.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index dbff4d7..ee9db75 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -240,14 +240,14 @@ typedef	__int64_t	sbintime_t;
 #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 *  
- * pointers rather than structs to ensure maximum binary compatability with
- * previous releases.
- * This means that we don't use the types defined here, but rather in
- * <machine/types.h>
+/*
+ * Cygwin is using a complete distinct implementation of pthread objects and
+ * pointers rather than structs.  This means we can'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>
 
@@ -430,11 +430,10 @@ typedef struct {
   int   is_initialized;  /* is this structure initialized? */
   int   init_executed;   /* has the initialization routine been run? */
 } pthread_once_t;       /* dynamic package initialization */
-#endif /* defined(_POSIX_THREADS) && !defined(__CYGWIN__) */
+#endif /* defined(_POSIX_THREADS) */
 
 /* POSIX Barrier Types */
 
-#if !defined(__CYGWIN__)
 #if defined(_POSIX_BARRIERS)
 typedef __uint32_t pthread_barrier_t;        /* POSIX Barrier Object */
 typedef struct {
@@ -462,6 +461,7 @@ typedef struct {
 #endif
 } pthread_rwlockattr_t;
 #endif /* defined(_POSIX_READER_WRITER_LOCKS) */
+
 #endif /* __CYGWIN__ */
 
 #include <machine/types.h>



More information about the Newlib-cvs mailing list