/* =========== Thread types and macros =========== */
-#if @GNULIB_PTHREAD_THREAD@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-thread.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_t rpl_pthread_t
-# define pthread_attr_t rpl_pthread_attr_t
-# endif
-# if !GNULIB_defined_pthread_thread_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_THREAD@
+# include "windows-thread.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_t rpl_pthread_t
+# define pthread_attr_t rpl_pthread_attr_t
+# endif
+# if !GNULIB_defined_pthread_thread_types
typedef glwthread_thread_t pthread_t;
typedef unsigned int pthread_attr_t;
-# define GNULIB_defined_pthread_thread_types 1
+# define GNULIB_defined_pthread_thread_types 1
+# endif
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_t rpl_pthread_t
+# define pthread_attr_t rpl_pthread_attr_t
+# endif
+# if !GNULIB_defined_pthread_thread_types
+typedef int pthread_t;
+typedef unsigned int pthread_attr_t;
+# define GNULIB_defined_pthread_thread_types 1
+# endif
# endif
# undef PTHREAD_CREATE_JOINABLE
# undef PTHREAD_CREATE_DETACHED
/* =========== Once-only control (initialization) types and macros ========== */
-#if @GNULIB_PTHREAD_ONCE@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-once.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_once_t rpl_pthread_once_t
-# endif
-# if !GNULIB_defined_pthread_once_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_ONCE@
+# include "windows-once.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_once_t rpl_pthread_once_t
+# endif
+# if !GNULIB_defined_pthread_once_types
typedef glwthread_once_t pthread_once_t;
-# define GNULIB_defined_pthread_once_types 1
+# define GNULIB_defined_pthread_once_types 1
+# endif
+# undef PTHREAD_ONCE_INIT
+# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_once_t rpl_pthread_once_t
+# endif
+# if !GNULIB_defined_pthread_once_types
+typedef int pthread_once_t;
+# define GNULIB_defined_pthread_once_types 1
+# endif
+# undef PTHREAD_ONCE_INIT
+# define PTHREAD_ONCE_INIT { 0 }
# endif
-# undef PTHREAD_ONCE_INIT
-# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT
#else
# if !@HAVE_PTHREAD_T@
# if !GNULIB_defined_pthread_once_types
/* =========== Mutex types and macros =========== */
-#if @GNULIB_PTHREAD_MUTEX@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-timedmutex.h"
-# include "windows-timedrecmutex.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_mutex_t rpl_pthread_mutex_t
-# define pthread_mutexattr_t rpl_pthread_mutexattr_t
-# endif
-# if !GNULIB_defined_pthread_mutex_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_MUTEX@
+# include "windows-timedmutex.h"
+# include "windows-timedrecmutex.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_mutex_t rpl_pthread_mutex_t
+# define pthread_mutexattr_t rpl_pthread_mutexattr_t
+# endif
+# if !GNULIB_defined_pthread_mutex_types
typedef struct
{
int type;
}
pthread_mutex_t;
typedef unsigned int pthread_mutexattr_t;
-# define GNULIB_defined_pthread_mutex_types 1
+# define GNULIB_defined_pthread_mutex_types 1
+# endif
+# undef PTHREAD_MUTEX_INITIALIZER
+# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } }
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_mutex_t rpl_pthread_mutex_t
+# define pthread_mutexattr_t rpl_pthread_mutexattr_t
+# endif
+# if !GNULIB_defined_pthread_mutex_types
+typedef int pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+# define GNULIB_defined_pthread_mutex_types 1
+# endif
+# undef PTHREAD_MUTEX_INITIALIZER
+# define PTHREAD_MUTEX_INITIALIZER { 0 }
# endif
-# undef PTHREAD_MUTEX_INITIALIZER
-# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } }
# undef PTHREAD_MUTEX_DEFAULT
# undef PTHREAD_MUTEX_NORMAL
# undef PTHREAD_MUTEX_ERRORCHECK
/* =========== Read-write lock types and macros =========== */
-#if @GNULIB_PTHREAD_RWLOCK@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-timedrwlock.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_rwlock_t rpl_pthread_rwlock_t
-# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
-# endif
-# if !GNULIB_defined_pthread_rwlock_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_RWLOCK@
+# include "windows-timedrwlock.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_rwlock_t rpl_pthread_rwlock_t
+# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
typedef glwthread_timedrwlock_t pthread_rwlock_t;
typedef unsigned int pthread_rwlockattr_t;
-# define GNULIB_defined_pthread_rwlock_types 1
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_rwlock_t rpl_pthread_rwlock_t
+# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
+typedef int pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER { 0 }
# endif
-# undef PTHREAD_RWLOCK_INITIALIZER
-# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT
#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_INIT@ /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */
# if @HAVE_PTHREAD_T@
# define pthread_rwlock_t rpl_pthread_rwlock_t
/* =========== Condition variable types and macros =========== */
-#if @GNULIB_PTHREAD_COND@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-cond.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_cond_t rpl_pthread_cond_t
-# define pthread_condattr_t rpl_pthread_condattr_t
-# endif
-# if !GNULIB_defined_pthread_cond_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_COND@
+# include "windows-cond.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_cond_t rpl_pthread_cond_t
+# define pthread_condattr_t rpl_pthread_condattr_t
+# endif
+# if !GNULIB_defined_pthread_cond_types
typedef glwthread_cond_t pthread_cond_t;
typedef unsigned int pthread_condattr_t;
-# define GNULIB_defined_pthread_cond_types 1
+# define GNULIB_defined_pthread_cond_types 1
+# endif
+# undef PTHREAD_COND_INITIALIZER
+# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_cond_t rpl_pthread_cond_t
+# define pthread_condattr_t rpl_pthread_condattr_t
+# endif
+# if !GNULIB_defined_pthread_cond_types
+typedef int pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+# define GNULIB_defined_pthread_cond_types 1
+# endif
+# undef PTHREAD_COND_INITIALIZER
+# define PTHREAD_COND_INITIALIZER { 0 }
# endif
-# undef PTHREAD_COND_INITIALIZER
-# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT
#else
# if !@HAVE_PTHREAD_T@
# if !GNULIB_defined_pthread_cond_types
/* =========== Thread-specific storage types and macros =========== */
-#if @GNULIB_PTHREAD_TSS@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-tls.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_key_t rpl_pthread_key_t
-# endif
-# if !GNULIB_defined_pthread_tss_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_TSS@
+# include "windows-tls.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_key_t rpl_pthread_key_t
+# endif
+# if !GNULIB_defined_pthread_tss_types
typedef glwthread_tls_key_t pthread_key_t;
-# define GNULIB_defined_pthread_tss_types 1
+# define GNULIB_defined_pthread_tss_types 1
+# endif
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_key_t rpl_pthread_key_t
+# endif
+# if !GNULIB_defined_pthread_tss_types
+typedef void ** pthread_key_t;
+# define GNULIB_defined_pthread_tss_types 1
+# endif
+# undef PTHREAD_DESTRUCTOR_ITERATIONS
+# define PTHREAD_DESTRUCTOR_ITERATIONS 0
# endif
-# undef PTHREAD_DESTRUCTOR_ITERATIONS
-# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS
#else
# if !@HAVE_PTHREAD_T@
# if !GNULIB_defined_pthread_tss_types
/* =========== Spinlock types and macros =========== */
-#if @GNULIB_PTHREAD_SPIN@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
-# include "windows-spin.h"
-# if @HAVE_PTHREAD_T@
-# define pthread_spinlock_t rpl_pthread_spinlock_t
-# endif
-# if !GNULIB_defined_pthread_spin_types
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_SPIN@
+# include "windows-spin.h"
+# if @HAVE_PTHREAD_T@
+# define pthread_spinlock_t rpl_pthread_spinlock_t
+# endif
+# if !GNULIB_defined_pthread_spin_types
typedef glwthread_spinlock_t pthread_spinlock_t;
-# define GNULIB_defined_pthread_spin_types 1
+# define GNULIB_defined_pthread_spin_types 1
+# endif
+# else
+# if @HAVE_PTHREAD_T@
+# define pthread_spinlock_t rpl_pthread_spinlock_t
+# endif
+# if !GNULIB_defined_pthread_spin_types
+typedef pthread_mutex_t pthread_spinlock_t;
+# define GNULIB_defined_pthread_spin_types 1
+# endif
# endif
# undef PTHREAD_PROCESS_PRIVATE
# undef PTHREAD_PROCESS_SHARED