/* --------------------------------------------------- */
/* begin of WINNT specific entries */
-#ifdef WINNT
+#if defined(WINNT) || defined(_WIN32)
/* don't suck in all of the win32 api */
#define WIN32_LEAN_AND_MEAN
-/* WindowsNT specific features */
-#define HAVE_NT_SERVICE_MANAGER 1
-#define HAVE_NT_EVENT_LOG 1
-
#define MAXPATHLEN _MAX_PATH
/* preprocess out undefined functions */
#include <ac/string.h>
#include <ac/unistd.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
#include <ldap.h>
#include "ldif.h"
#include <process.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
#include <lber.h>
#include <ldap.h>
#undef LDAP_SIGUSR1
#undef LDAP_SIGUSR2
-# if defined(WINNT) || defined(_WINNT)
+# if defined(WINNT) || defined(_WINNT) || defined(_WIN32)
# define LDAP_SIGUSR1 SIGILL
# define LDAP_SIGUSR2 SIGTERM
LDAP_END_DECL
/* If we're in the NT env at all, we want these defs, threaded or not */
-#elif defined(WINNT) || defined(_WINNT) /* HAVE_NT_THREADS */
+#elif defined(WINNT) || defined(_WINNT) || defined(_WIN32) /* HAVE_NT_THREADS */
LDAP_BEGIN_DECL
/* --------------------------------------------------- */
/* begin of WINNT specific entries */
-#ifdef WINNT
+#if defined(WINNT) || defined(_WIN32)
/* don't suck in all of the win32 api */
#define WIN32_LEAN_AND_MEAN
-/* WindowsNT specific features */
-#define HAVE_NT_SERVICE_MANAGER 1
-#define HAVE_NT_EVENT_LOG 1
-
#define MAXPATHLEN _MAX_PATH
/* preprocess out undefined functions */
#include <windows.h>
-#ifdef HAVE_WINSOCK
+#ifdef HAVE_WINSOCK2
+#include <winsock2.h>
+#elif HAVE_WINSOCK
#include <winsock.h>
+#endif /* HAVE_WINSOCK(2) */
#define __RETSTR( x ) case x: return #x;
#undef __RETSTR
-#endif /* HAVE_WINSOCK */
-
-
char *GetErrorString( int err )
{
static char msgBuf[1024];