summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>1999-01-08 22:38:54 +0000
committerrpj <rpj>1999-01-08 22:38:54 +0000
commit6cd9f4f23d033e61bc9c742a0598040b9caadf89 (patch)
treeacaaf541a663edfef5837037e1ddda8a3a96e0c9
parent5f3c7322e8f3f35cb0f8c250f337596c83961b25 (diff)
Sat Jan 9 14:32:08 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h: Compile-time switch for CYGWIN derived environments to use CreateThread instead of _beginthreadex. Ditto for ExitThread. Patch provided by Anders Norlander <anorland@hem2.passagen.se>.
-rw-r--r--ChangeLog6
-rw-r--r--README7
-rw-r--r--implement.h31
3 files changed, 41 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 007fe07..260398d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 9 14:32:08 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
+
+ * implement.h: Compile-time switch for CYGWIN derived environments
+ to use CreateThread instead of _beginthreadex. Ditto for ExitThread.
+ Patch provided by Anders Norlander <anorland@hem2.passagen.se>.
+
Tue Jan 5 16:33:04 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* cleanup.c (_pthread_pop_cleanup): Add C++ version of __try/__except
diff --git a/README b/README
index 603ba90..71f33de 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ This directory contains an implementation of pthreads for Win32.
Mailing list
------------
-Dec 10 1998
+Dec 10, 1998
There is a mailing list for discussing pthreads on Win32 which is
managed by Majordomo. To subscribe, send mail to majordomo@air.net.au
@@ -13,7 +13,7 @@ and place the fllowing text in the message body:
Building the library with Cygwin32 or Mingw32
---------------------------------------------
-Dec 2 1998
+Jan 9, 1999
The package cannot yet be built using cygwin32 or mingw32 because
the win32 compatibility stub libraries that come with those tools generate
@@ -21,7 +21,8 @@ their stub library function calls from the Win95 dll set
which don't include the _beginthreadx or _endthreadx functions used in this
package.
-A precompiled DLL and matching include file can be found at:
+The complete zipped (should be pkunzip compatible) source code and
+a precompiled DLL and matching pthread.h can be found at:
ftp://sourceware.cygnus.com/pub/pthreads-win32
Home page:
diff --git a/implement.h b/implement.h
index 6bcedf6..79342e1 100644
--- a/implement.h
+++ b/implement.h
@@ -172,4 +172,35 @@ void _pthread_tkAssocDestroy (ThreadKeyAssoc * assoc);
/* </JEB> */
+/*
+ * Check for old and new versions of cygwin. See the FAQ file:
+ *
+ * Question 1 - How do I get pthreads-win32 to link under Cygwin32 or Mingw32?
+ *
+ * Patch by Anders Norlander <anorland@hem2.passagen.se>
+ */
+#if defined(__CYGWIN32__) || defined(__CYGWIN__)
+
+/* Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
+ * in order to avoid warnings because of return type
+ */
+
+#define _beginthreadex(security, \
+ stack_size, \
+ start_proc, \
+ arg, \
+ flags, \
+ pid) \
+ CreateThread(security, \
+ stack_size, \
+ (LPTHREAD_START_ROUTINE) start_proc, \
+ arg, \
+ flags, \
+ pid)
+
+#define _endthreadex ExitThread
+
+#endif /* __CYGWIN32__ || __CYGWIN__ */
+
+
#endif /* _IMPLEMENT_H */