#include <stdlib.h>
#include <stdio.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#include <windef.h>
+#include <winbase.h>
+#include <objbase.h>
#include <winsock2.h>
-#include <windows.h>
+//#include <windows.h>
#include <sys/types.h>
#include <time.h>
#include <errno.h>
#define ADNS_CLEAR_ERRNO {WSASetLastError(errno = 0);}
#define ENOBUFS WSAENOBUFS
+
+/* FIXME: there are two types of defines for this,
+ * one points to WSAEWOULDBLOCK and the other is from errno.h */
+#ifdef EWOULDBLOCK
+#undef EWOULDBLOCK
+#endif
+
#define EWOULDBLOCK WSAEWOULDBLOCK
+
#define EINPROGRESS WSAEINPROGRESS
#define EMSGSIZE WSAEMSGSIZE
#define ENOPROTOOPT WSAENOPROTOOPT