mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
fix for win32 (need to init winsock)
This commit is contained in:
parent
d69c8013aa
commit
cc89fb23c8
1 changed files with 11 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue