diff --git a/mdig/mdig.c b/mdig/mdig.c index b43b930..cf69aa3 100644 --- a/mdig/mdig.c +++ b/mdig/mdig.c @@ -7,6 +7,7 @@ #define _GNU_SOURCE #include +#include #include #include #include @@ -14,10 +15,18 @@ #include #include #include +#ifdef _WIN32 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x600 +#include +#include +#include +#else #include #include #include #include +#endif #include #define RESOLVER_EAGAIN_ATTEMPTS 2 @@ -56,8 +65,10 @@ static const char* eai_str(int r) return "EAI_SERVICE"; case EAI_SOCKTYPE: return "EAI_SOCKTYPE"; +#ifdef EAI_SYSTEM case EAI_SYSTEM: return "EAI_SYSTEM"; +#endif default: return "UNKNOWN"; } @@ -384,6 +395,15 @@ int main(int argc, char **argv) } } +#ifdef _WIN32 + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2, 2), &wsaData)) + { + fprintf(stderr,"WSAStartup failed\n"); + goto ex; + } +#endif + if (*fn1) { glob.F_log_resolved = fopen(fn1,"wt");