diff --git a/qw/source/master.c b/qw/source/master.c index 1632f93d1..dc886fd95 100644 --- a/qw/source/master.c +++ b/qw/source/master.c @@ -226,6 +226,9 @@ QW_Master (struct sockaddr_in *addr) server_t *servers; int serverlen = SLIST_MULTIPLE; int i; +#ifdef _WIN32 + WSADATA winsockdata; +#endif servers = malloc (sizeof (server_t) * serverlen); if (!servers) { @@ -236,6 +239,14 @@ QW_Master (struct sockaddr_in *addr) for (i = 0; i < serverlen; i++) servers[i].updated = 0; +#ifdef _WIN32 + i = WSAStartup (MAKEWORD (1, 1), &winsockdata); + if (i) { + printf ("Winsock initialization failed.\n"); + return; + } +#endif + sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (sock < 0) { printf ("socket failed\n");