--- unwind-dw2-fde.c.org 2002-08-16 16:55:17.000000000 +0200 +++ unwind-dw2-fde.c 2002-10-16 09:30:47.000000000 +0200 @@ -53,11 +53,17 @@ extern void** __w32_sharedptr_seen_objec #define seen_objects (*(struct object**)( __w32_sharedptr_seen_objects)) #endif +#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) #ifdef __GTHREAD_MUTEX_INIT static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT; #else static __gthread_mutex_t object_mutex; #endif +#else +extern void * __w32_sharedptr_object_mutex; +#define object_mutex (*(__gthread_mutex_t*)( __w32_sharedptr_object_mutex)) +#endif + #ifdef __GTHREAD_MUTEX_INIT_FUNCTION static void @@ -69,8 +75,16 @@ init_object_mutex (void) static void init_object_mutex_once (void) { +#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) static __gthread_once_t once = __GTHREAD_ONCE_INIT; +#else +extern void * __w32_sharedptr_init_object_mutex_once; +#define once (*(__gthread_once_t*)( __w32_sharedptr_init_object_mutex_once)) +#endif __gthread_once (&once, init_object_mutex); +#if (defined (__MINGW32__ ) || defined (__CYGWIN__)) +#undef once +#endif } #else #define init_object_mutex_once() @@ -431,7 +445,12 @@ static inline void fde_split (struct object *ob, fde_compare_t fde_compare, struct fde_vector *linear, struct fde_vector *erratic) { +#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) static fde *marker; +#else +extern void ** __w32_sharedptr_marker; +#define marker (*(fde **)( __w32_sharedptr_marker)) +#endif size_t count = linear->count; fde **chain_end = ▮ size_t i, j, k; @@ -467,6 +486,9 @@ fde_split (struct object *ob, fde_compar erratic->array[k++] = linear->array[i]; linear->count = j; erratic->count = k; +#if (defined (__MINGW32__ ) || defined (__CYGWIN__)) +#undef marker +#endif } /* This is O(n log(n)). BSD/OS defines heapsort in stdlib.h, so we must