+#if defined( HAVE_PTHREADS )
+/**********************************
+ * *
+ * definitions for POSIX Threads *
+ * *
+ **********************************/
+
+#include <pthread.h>
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif
+
+LDAP_BEGIN_DECL
+
+#if !defined( HAVE_PTHREAD_ATTR_INIT ) && \
+ defined( HAVE_PTHREAD_ATTR_CREATE )
+#define pthread_attr_init( a ) pthread_attr_create( a )
+#endif
+
+#if !defined( HAVE_PTHREAD_ATTR_DESTROY ) && \
+ defined( HAVE_PTHREAD_ATTR_DELETE )
+#define pthread_attr_destroy( a ) pthread_attr_delete( a )
+#endif
+
+#if !defined( HAVE_PTHREAD_ATTR_SETDETACHSTATE ) && \
+ defined( HAVE_PTHREAD_ATTR_SETDETACH_NP )
+#define pthread_attr_setdetachstate( a, b ) \
+ pthread_attr_setdetach_np( a, b )
+#endif
+
+#ifndef HAVE_PTHREAD_KILL
+/* missing pthread_kill(), define prototype */
+LDAP_F void pthread_kill LDAP_P(( pthread_t tid, int sig ));
+#endif
+
+#ifndef HAVE_PTHREADS_D4
+#define pthread_mutexattr_default NULL
+#define pthread_condattr_default NULL
+
+#ifdef HAVE_SCHED_YIELD
+#define pthread_yield sched_yield
+#endif
+#endif
+
+LDAP_END_DECL
+
+#elif defined ( HAVE_MACH_CTHREADS )
+/**********************************
+ * *
+ * definitions for Mach CThreads *
+ * *
+ **********************************/