summaryrefslogtreecommitdiff
path: root/implement.h
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 /implement.h
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>.
Diffstat (limited to 'implement.h')
-rw-r--r--implement.h31
1 files changed, 31 insertions, 0 deletions
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 */