On Mon, 2008-06-16 at 09:52 +1000, Bojan Smojver wrote:

> Does this help?

Sorry, other LDAP toolkits may complain. This should be slightly better.

-- 
Bojan
Index: ldap/apr_ldap_rebind.c
===================================================================
--- ldap/apr_ldap_rebind.c	(revision 667454)
+++ ldap/apr_ldap_rebind.c	(working copy)
@@ -286,7 +286,11 @@
 
 static int apr_ldap_rebind_set_callback(LDAP *ld)
 {
+#if defined(LDAP_SET_REBIND_PROC_THREE)
     ldap_set_rebind_proc(ld, LDAP_rebindproc, NULL);
+#else
+    ldap_set_rebind_proc(ld, LDAP_rebindproc);
+#endif
     return APR_SUCCESS;
 }
 
Index: build/apu-conf.m4
===================================================================
--- build/apu-conf.m4	(revision 667454)
+++ build/apu-conf.m4	(working copy)
@@ -356,6 +356,26 @@
     LIBS=$save_libs
   ])
 
+if test "$apu_has_ldap" = "1"; then
+    AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style,
+    APR_TRY_COMPILE_NO_WARNING([
+    #ifdef HAVE_LBER_H
+    #include <lber.h>
+    #endif
+    #ifdef HAVE_LDAP_H
+    #include <ldap.h>
+    #endif
+    ], [
+    int tmp = ldap_set_rebind_proc((void *)0, (void *)0, (void *)0);
+    /* use tmp to suppress the warning */
+    tmp=0;
+    ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two))
+
+    if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then
+        AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments])
+    fi
+fi
+
 AC_SUBST(ldap_h)
 AC_SUBST(lber_h)
 AC_SUBST(ldap_ssl_h)

Reply via email to