--- include/ldap_pvt_thread.h~	2008-11-12 07:37:16.000000000 +0000
+++ include/ldap_pvt_thread.h	2008-11-12 08:01:45.000000000 +0000
@@ -59,12 +59,12 @@
 
 #ifndef LDAP_PVT_THREAD_H_DONE
 #define	LDAP_PVT_THREAD_SET_STACK_SIZE
-#ifndef LDAP_PVT_THREAD_STACK_SIZE
-	/* LARGE stack. Will be twice as large on 64 bit machine. */
-#define LDAP_PVT_THREAD_STACK_SIZE	( 1 * 1024 * 1024 * sizeof(void *) )
 /* May be explicitly defined to zero to disable it */
-#elif LDAP_PVT_THREAD_STACK_SIZE == 0
+#if LDAP_PVT_THREAD_STACK_SIZE == 0
 #undef LDAP_PVT_THREAD_SET_STACK_SIZE
+#elif !defined(LDAP_PVT_THREAD_STACK_SIZE)
+	/* LARGE stack. Will be twice as large on 64 bit machine. */
+#define LDAP_PVT_THREAD_STACK_SIZE	( 1 * 1024 * 1024 * sizeof(void *) )
 #endif
 #endif /* !LDAP_PVT_THREAD_H_DONE */
 
--- libraries/libldap/os-ip.c~	2008-11-12 07:33:10.000000000 +0000
+++ libraries/libldap/os-ip.c	2008-11-12 07:33:31.000000000 +0000
@@ -690,7 +690,7 @@
 		char *herr;
 #ifdef NI_MAXHOST
 		char hbuf[NI_MAXHOST];
-#elif defined( MAXHOSTNAMELEN
+#elif defined( MAXHOSTNAMELEN )
 		char hbuf[MAXHOSTNAMELEN];
 #else
 		char hbuf[256];

