summaryrefslogtreecommitdiff
path: root/cleanup.c
diff options
context:
space:
mode:
authorrpj <rpj>1999-01-23 06:58:47 +0000
committerrpj <rpj>1999-01-23 06:58:47 +0000
commit6237335fec273ac2b00c32609a8eef91c6ec7473 (patch)
tree11a0048f90cda86fc653ac525b63650759e423cc /cleanup.c
parent984d83b8c134a4dde2dddb31564d3d47b0da8c25 (diff)
Fixing problems building with GNU compilers:
Sun Jan 24 01:34:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * semaphore.c (sem_wait): Remove second arg to pthreadCancelableWait() call. Fri Jan 22 14:31:59 1999 Ross Johnson <rpj@swan.canberra.edu.au> * Makefile.in (CFLAGS): Remove -fhandle-exceptions. Not needed with egcs. Add -g for debugging. * create.c (pthread_create): Replace __stdcall with PT_STDCALL macro. This is a hack and must be fixed. * misc.c (CancelableWait): Remove redundant statement. * mutex.c (pthread_mutexattr_init): Cast calloc return value. * misc.c (CancelableWait): Add cast. (pthread_self): Add cast. * exit.c (pthread_exit): Add cast. * condvar.c (pthread_condattr_init): Cast calloc return value. * cleanup.c: Reorganise conditional compilation. * attr.c (pthread_attr_init): Remove unused 'result'. Cast malloc return value. * private.c (_pthread_callUserDestroyRoutines): Redo conditional compilation. * misc.c (CancelableWait): C++ version uses 'throw'. * cancel.c (pthread_testcancel): Ditto. * implement.h (class pthread_exception): Define for C++. * pthread.h: Fix C, C++, and Win32 SEH condition compilation mayhem around pthread_cleanup_* defines. C++ version now uses John Bossom's cleanup handlers. (pthread_attr_t): Make 'valid' unsigned. Define '_timeb' as 'timeb' for Ming32. Define PT_STDCALL as nothing for Mingw32. May be temporary. * cancel.c (pthread_testcancel): Cast return value.
Diffstat (limited to 'cleanup.c')
-rw-r--r--cleanup.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/cleanup.c b/cleanup.c
index 199101b..3a1613c 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -44,14 +44,14 @@ _pthread_pop_cleanup (int execute)
{
_pthread_cleanup_t *cleanup;
- cleanup = pthread_getspecific (_pthread_cleanupKey);
+ cleanup = (_pthread_cleanup_t *) pthread_getspecific (_pthread_cleanupKey);
if (cleanup != NULL)
{
if (execute && (cleanup->routine != NULL))
{
-#ifdef _WIN32
+#ifdef _MSC_VER
__try
{
@@ -69,7 +69,7 @@ _pthread_pop_cleanup (int execute)
*/
}
-#else /* _WIN32 */
+#else /* _MSC_VER */
#ifdef __cplusplus
@@ -91,7 +91,7 @@ _pthread_pop_cleanup (int execute)
#else /* __cplusplus */
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__GNUC__)
#warning Compile __FILE__ as C++ or thread cancellation will not work properly.
#endif
@@ -102,15 +102,16 @@ _pthread_pop_cleanup (int execute)
#endif /* __cplusplus */
-#endif /* _WIN32 */
+#endif /* _MSC_VER */
}
-#if !defined(_WIN32) && !defined(__cplusplus)
+#if !defined(_MSC_VER) && !defined(__cplusplus)
- pthread_setspecific (_pthread_cleanupKey, cleanup->prev);
+ pthread_setspecific (_pthread_cleanupKey, (void *) cleanup->prev);
#endif
+
}
return (cleanup);
@@ -165,9 +166,9 @@ _pthread_push_cleanup (_pthread_cleanup_t * cleanup,
cleanup->routine = routine;
cleanup->arg = arg;
-#if !defined(_WIN32) && !defined(__cplusplus)
+#if !defined(_MSC_VER) && !defined(__cplusplus)
- cleanup->prev = pthread_getspecific (_pthread_cleanupKey);
+ cleanup->prev = (_pthread_cleanup_t *) pthread_getspecific (_pthread_cleanupKey);
#endif
@@ -177,4 +178,3 @@ _pthread_push_cleanup (_pthread_cleanup_t * cleanup,
/* </JEB> */
-