From 65f207e8b906dad44844227fdb7cdcf397496552 Mon Sep 17 00:00:00 2001 From: Thomas Pfaff Date: Thu, 9 Jan 2003 21:14:33 +0000 Subject: [PATCH] Apply pthread_types_patch --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/include/cygwin/types.h | 18 +++++++++--------- winsup/cygwin/include/pthread.h | 4 ++-- winsup/cygwin/include/semaphore.h | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a6a0d1daa..3947fbed0 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2003-01-09 Thomas Pfaff + + * include/semaphore.h: Modify typedef for sem_t. + * include/cygwin/types.h: Modify typedefs for pthread_t, + pthread_mutex_t, pthread_key_t, pthread_attr_t, + pthread_mutexattr_t, pthread_condattr_t, pthread_cond_t, + pthread_rwlock_t and pthread_rwlockattr_t. + 2003-01-09 Thomas Pfaff * thread.h (WAIT_CANCELED): New define. diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index 69bfa2056..caa826fce 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -61,14 +61,14 @@ typedef __gid16_t gid_t; #if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus) -typedef void *pthread_t; -typedef void *pthread_mutex_t; +typedef struct __pthread_t {char __dummy;} *pthread_t; +typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t; -typedef void *pthread_key_t; -typedef void *pthread_attr_t; -typedef void *pthread_mutexattr_t; -typedef void *pthread_condattr_t; -typedef void *pthread_cond_t; +typedef struct __pthread_key_t {char __dummy;} *pthread_key_t; +typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t; +typedef struct __pthread_mutexattr_t {char __dummy;} *pthread_mutexattr_t; +typedef struct __pthread_condattr_t {char __dummy;} *pthread_condattr_t; +typedef struct __pthread_cond_t {char __dummy;} *pthread_cond_t; /* These variables are not user alterable. This means you!. */ typedef struct @@ -77,8 +77,8 @@ typedef struct int state; } pthread_once_t; -typedef void *pthread_rwlock_t; -typedef void *pthread_rwlockattr_t; +typedef struct __pthread_rwlock_t {char __dummy;} *pthread_rwlock_t; +typedef struct __pthread_rwlockattr_t {char __dummy;} *pthread_rwlockattr_t; #else diff --git a/winsup/cygwin/include/pthread.h b/winsup/cygwin/include/pthread.h index 0dff00053..b1afe9300 100644 --- a/winsup/cygwin/include/pthread.h +++ b/winsup/cygwin/include/pthread.h @@ -44,7 +44,7 @@ extern "C" #define PTHREAD_CANCEL_DISABLE 1 #define PTHREAD_CANCELED ((void *)-1) /* this should be a value that can never be a valid address */ -#define PTHREAD_COND_INITIALIZER (void *)21 +#define PTHREAD_COND_INITIALIZER (pthread_cond_t)21 #define PTHREAD_CREATE_DETACHED 1 /* the default : joinable */ #define PTHREAD_CREATE_JOINABLE 0 @@ -54,7 +54,7 @@ extern "C" #define PTHREAD_MUTEX_RECURSIVE 1 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK /* this should be too low to ever be a valid address */ -#define PTHREAD_MUTEX_INITIALIZER (void *)20 +#define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t)20 #define PTHREAD_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, 0 } #define PTHREAD_PRIO_INHERIT #define PTHREAD_PRIO_NONE diff --git a/winsup/cygwin/include/semaphore.h b/winsup/cygwin/include/semaphore.h index 6dbfa09ac..500b8f7a4 100644 --- a/winsup/cygwin/include/semaphore.h +++ b/winsup/cygwin/include/semaphore.h @@ -21,7 +21,7 @@ extern "C" #endif #ifndef __INSIDE_CYGWIN__ - typedef void *sem_t; + typedef struct __sem_t {char __dummy;} *sem_t; #endif #define SEM_FAILED 0 -- 2.43.5