* find current contact information at www.novell.com.
*/
-#include <ldap.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
+#include "digest_common.h"
+
+#ifdef _SQUID_MSWIN_ /* Native Windows port and MinGW */
+
+#define snprintf _snprintf
+#include <windows.h>
+#include <winldap.h>
+#ifndef LDAPAPI
+#define LDAPAPI __cdecl
+#endif
+#ifdef LDAP_VERSION3
+#ifndef LDAP_OPT_X_TLS
+#define LDAP_OPT_X_TLS 0x6000
+#endif
+#define ber_alloc() ber_alloc_t(0)
+#endif /* LDAP_VERSION3 */
+
+#else
+
+#include <lber.h>
+#include <ldap.h>
+
+#endif
#include "edir_ldapext.h"
#include <stdlib.h>
#include <ctype.h>
#include "ldap_backend.h"
-#include "edir_ldapext.h"
#ifdef _SQUID_MSWIN_ /* Native Windows port and MinGW */
#include <ldap.h>
#endif
+#include "edir_ldapext.h"
#define PROGRAM_NAME "digest_pw_auth(LDAP_backend)"
/* Globals */