--- a/libraries/libldap/tls2.c
+++ b/libraries/libldap/tls2.c
@@ -41,6 +41,7 @@ static tls_impl *tls_imp = &ldap_int_tls_impl;
 #define HAS_TLS( sb )	ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO, \
 				(void *)tls_imp->ti_sbio )
 
+static int ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in );
 #endif /* HAVE_TLS */
 
 #ifdef LDAP_DEVEL
