From 7bd5b261fb5866ef9c0335eeb841920c33c2cf1b Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 31 May 1999 19:59:29 +0000 Subject: [PATCH] Move most header inclusion below #ifdef HAVE_XXX. Use LDAP_MALLOC instead of ch_malloc --- libraries/libldap_r/thr_cthreads.c | 2 +- libraries/libldap_r/thr_lwp.c | 9 ++++----- libraries/libldap_r/thr_nt.c | 3 ++- libraries/libldap_r/thr_posix.c | 3 ++- libraries/libldap_r/thr_sleep.c | 3 ++- libraries/libldap_r/thr_stub.c | 3 ++- libraries/libldap_r/thr_thr.c | 3 ++- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/libraries/libldap_r/thr_cthreads.c b/libraries/libldap_r/thr_cthreads.c index a52c406a9c..f6526b16ed 100644 --- a/libraries/libldap_r/thr_cthreads.c +++ b/libraries/libldap_r/thr_cthreads.c @@ -11,9 +11,9 @@ /* thr_cthreads.c - wrapper for mach cthreads */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( HAVE_MACH_CTHREADS ) +#include "ldap_pvt_thread.h" /*********************************************************************** * * diff --git a/libraries/libldap_r/thr_lwp.c b/libraries/libldap_r/thr_lwp.c index f9bc0b415f..6ae1d22b71 100644 --- a/libraries/libldap_r/thr_lwp.c +++ b/libraries/libldap_r/thr_lwp.c @@ -16,7 +16,6 @@ */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( HAVE_LWP ) @@ -33,9 +32,9 @@ #include #include -#include "lber.h" -#include "ldap.h" -#include "ldap_log.h" +#include "ldap-int.h" + +#include "ldap_pvt_thread.h" #include #include @@ -81,7 +80,7 @@ static stkalign_t * ldap_pvt_thread_get_stack( int *stacknop ) int i; if ( stacks == NULL ) { - stacks = (struct stackinfo *) ch_calloc( 1, MAX_THREADS * + stacks = (struct stackinfo *) LDAP_CALLOC( 1, MAX_THREADS * sizeof(struct stackinfo) ); } diff --git a/libraries/libldap_r/thr_nt.c b/libraries/libldap_r/thr_nt.c index a9b72b2e77..8d79a5e2a8 100644 --- a/libraries/libldap_r/thr_nt.c +++ b/libraries/libldap_r/thr_nt.c @@ -11,10 +11,11 @@ /* thr_nt.c - wrapper around NT threads */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( HAVE_NT_THREADS ) +#include "ldap_pvt_thread.h" + int ldap_pvt_thread_initialize( void ) { diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index da8ef99c43..e8d927fb52 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -13,11 +13,12 @@ #include "portable.h" +#if defined( HAVE_PTHREADS ) + #include #include "ldap_pvt_thread.h" -#if defined( HAVE_PTHREADS ) #if HAVE_PTHREADS_D4 # define LDAP_PVT_THREAD_ATTR_DEFAULT pthread_attr_default diff --git a/libraries/libldap_r/thr_sleep.c b/libraries/libldap_r/thr_sleep.c index b6328fcd70..aa38ebd1a5 100644 --- a/libraries/libldap_r/thr_sleep.c +++ b/libraries/libldap_r/thr_sleep.c @@ -27,13 +27,14 @@ #include "portable.h" +#if !defined( HAVE_LWP ) + #include #include #include /* get sleep() */ #include "ldap_pvt_thread.h" -#if !defined( HAVE_LWP ) /* * Here we assume we have fully preemptive threads and that sleep() diff --git a/libraries/libldap_r/thr_stub.c b/libraries/libldap_r/thr_stub.c index 7cd8e5f6be..3909ebe238 100644 --- a/libraries/libldap_r/thr_stub.c +++ b/libraries/libldap_r/thr_stub.c @@ -11,10 +11,11 @@ /* thr_stub.c - stubs for the threads */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( NO_THREADS ) +#include "ldap_pvt_thread.h" + /*********************************************************************** * * * no threads package defined for this system - fake ok returns from * diff --git a/libraries/libldap_r/thr_thr.c b/libraries/libldap_r/thr_thr.c index 29a6c390a2..eb7a5a16f1 100644 --- a/libraries/libldap_r/thr_thr.c +++ b/libraries/libldap_r/thr_thr.c @@ -11,10 +11,11 @@ /* thr_thr.c - wrappers around solaris threads */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( HAVE_THR ) +#include "ldap_pvt_thread.h" + /******************* * * * Solaris Threads * -- 2.39.5