delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/08/13:15:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "C. Ripple" <chr_news AT gmx DOT net>
To: <tpfaff AT gmx DOT net>
Cc: <cygwin AT cygwin DOT com>
Subject: RE: [PATCH] Modified pthread types; From: cygwin-patches AT cygwin DOT com
Date: Mon, 8 Jul 2002 19:13:41 +0200
Message-ID: <002001c226a2$d00d5f90$0100a8c0@lony>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
In-Reply-To:
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Importance: Normal
Note-from-DJ: This may be spam

------=_NextPart_000_0021_01C226B3.93962F90
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

> From: Christoph
...
> Using your patch I needed to tweak /usr/include/pthreads.h
> when compiling libstdc++.  Also I don't think that I saw a
> memory leak when running your test program from the
> cygwin-patch mailing list.

Of course I screwed this up. To compile the cygwin dll 
it self one needs to put a guard

#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)

around 

> -#define PTHREAD_COND_INITIALIZER (void *)21
> +#define PTHREAD_COND_INITIALIZER (pthread_mutex_t)21

The patch contains Thomas's original patch + my micro 
modification.


/Christoph

------=_NextPart_000_0021_01C226B3.93962F90
Content-Type: application/octet-stream;
	name="pthread_types.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="pthread_types.patch"

diff -urp src.old/winsup/cygwin/include/cygwin/types.h =
src/winsup/cygwin/include/cygwin/types.h=0A=
--- src.old/winsup/cygwin/include/cygwin/types.h	2002-06-06 =
17:35:09.000000000 +0200=0A=
+++ src/winsup/cygwin/include/cygwin/types.h	2002-07-08 =
17:29:28.000000000 +0200=0A=
@@ -61,14 +61,21 @@ typedef __gid16_t gid_t;=0A=
 =0A=
 #if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)=0A=
 =0A=
-typedef void *pthread_t;=0A=
-typedef void *pthread_mutex_t;=0A=
-=0A=
-typedef void *pthread_key_t;=0A=
-typedef void *pthread_attr_t;=0A=
-typedef void *pthread_mutexattr_t;=0A=
-typedef void *pthread_condattr_t;=0A=
-typedef void *pthread_cond_t;=0A=
+typedef struct {char __dummy;} __pthread_t;=0A=
+typedef __pthread_t *pthread_t;=0A=
+typedef struct {char __dummy;} __pthread_mutex_t;=0A=
+typedef __pthread_mutex_t *pthread_mutex_t;=0A=
+=0A=
+typedef struct {char __dummy;} __pthread_key_t;=0A=
+typedef __pthread_key_t *pthread_key_t;=0A=
+typedef struct {char __dummy;} __pthread_attr_t;=0A=
+typedef __pthread_attr_t *pthread_attr_t;=0A=
+typedef struct {char __dummy;} __pthread_mutexattr_t;=0A=
+typedef __pthread_mutexattr_t *pthread_mutexattr_t;=0A=
+typedef struct {char __dummy;} __pthread_condattr_t;=0A=
+typedef __pthread_condattr_t *pthread_condattr_t;=0A=
+typedef struct {char __dummy;} __pthread_cond_t;=0A=
+typedef __pthread_cond_t *pthread_cond_t;=0A=
 =0A=
   /* These variables are not user alterable. This means you!. */=0A=
 typedef struct=0A=
@@ -77,8 +84,10 @@ typedef struct=0A=
   int state;=0A=
 }=0A=
 pthread_once_t;=0A=
-typedef void *pthread_rwlock_t;=0A=
-typedef void *pthread_rwlockattr_t;=0A=
+typedef struct {char __dummy;} __pthread_rwlock_t;=0A=
+typedef __pthread_rwlock_t *pthread_rwlock_t;=0A=
+typedef struct {char __dummy;} __pthread_rwlockattr_t;=0A=
+typedef __pthread_rwlockattr_t *pthread_rwlockattr_t;=0A=
 =0A=
 #else=0A=
 =0A=
diff -urp src.old/winsup/cygwin/include/pthread.h =
src/winsup/cygwin/include/pthread.h=0A=
--- src.old/winsup/cygwin/include/pthread.h	2002-07-04 =
16:17:30.000000000 +0200=0A=
+++ src/winsup/cygwin/include/pthread.h	2002-07-08 17:40:26.000000000 =
+0200=0A=
@@ -44,7 +44,12 @@ extern "C"=0A=
 #define PTHREAD_CANCEL_DISABLE 1=0A=
 #define PTHREAD_CANCELED ((void *)-1)=0A=
 /* this should be a value that can never be a valid address */=0A=
+#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)=0A=
+#define PTHREAD_COND_INITIALIZER (pthread_cond_t)21=0A=
+#else=0A=
 #define PTHREAD_COND_INITIALIZER (void *)21=0A=
+#endif=0A=
+=0A=
 #define PTHREAD_CREATE_DETACHED 1=0A=
 /* the default : joinable */=0A=
 #define PTHREAD_CREATE_JOINABLE 0=0A=
@@ -54,7 +59,12 @@ extern "C"=0A=
 #define PTHREAD_MUTEX_ERRORCHECK 1=0A=
 #define PTHREAD_MUTEX_NORMAL 2=0A=
 /* this should be too low to ever be a valid address */=0A=
+#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)=0A=
+#define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t)20=0A=
+#else=0A=
 #define PTHREAD_MUTEX_INITIALIZER (void *)20=0A=
+#endif=0A=
+=0A=
 #define PTHREAD_MUTEX_RECURSIVE 0=0A=
 #define PTHREAD_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, 0 }=0A=
 #define PTHREAD_PRIO_INHERIT=0A=
@@ -103,7 +113,7 @@ void pthread_cleanup_push (void (*routin=0A=
 void pthread_cleanup_pop (int execute);=0A=
 */=0A=
 typedef void (*__cleanup_routine_type) (void *);=0A=
-typedef struct _pthread_cleanup_handler =0A=
+typedef struct _pthread_cleanup_handler=0A=
 {=0A=
   __cleanup_routine_type function;=0A=
   void *arg;=0A=
diff -urp src.old/winsup/cygwin/include/semaphore.h =
src/winsup/cygwin/include/semaphore.h=0A=
--- src.old/winsup/cygwin/include/semaphore.h	2001-03-21 =
17:06:22.000000000 +0100=0A=
+++ src/winsup/cygwin/include/semaphore.h	2002-07-08 17:29:28.000000000 =
+0200=0A=
@@ -21,7 +21,8 @@ extern "C"=0A=
 #endif=0A=
 =0A=
 #ifndef __INSIDE_CYGWIN__=0A=
-  typedef void *sem_t;=0A=
+  typedef struct {char __dummy;} __sem_t;=0A=
+  typedef __sem_t *sem_t;=0A=
 #endif=0A=
 =0A=
 #define SEM_FAILED 0=0A=


------=_NextPart_000_0021_01C226B3.93962F90
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_0021_01C226B3.93962F90--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019