From ffb90a510a9225d373dc3f9c811392c4c31c05a9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 30 Sep 2002 16:40:06 +0000 Subject: [PATCH] win32 compile fixes --- libs/util/quakeio.c | 3 +-- nq/source/net_wins.c | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/util/quakeio.c b/libs/util/quakeio.c index 3a611e380..6b47000d8 100644 --- a/libs/util/quakeio.c +++ b/libs/util/quakeio.c @@ -233,8 +233,7 @@ Qdopen (int fd, const char *mode) int zip = 0; #ifdef WIN32 - if (file->file) - setmode (_fileno (file->file), O_BINARY); + setmode (fd, O_BINARY); #endif for (p = m; *mode && p - m < (sizeof (m) - 1); mode++) { if (*mode == 'z') { diff --git a/nq/source/net_wins.c b/nq/source/net_wins.c index 683afa144..b7eccdd6f 100644 --- a/nq/source/net_wins.c +++ b/nq/source/net_wins.c @@ -378,7 +378,7 @@ PartialIPAddress (const char *in, struct qsockaddr *hostaddr) else port = net_hostport; - hostaddr->sa_family = AF_INET; + hostaddr->qsa_family = AF_INET; ((struct sockaddr_in *) hostaddr)->sin_port = htons ((short) port); ((struct sockaddr_in *) hostaddr)->sin_addr.s_addr = @@ -511,7 +511,7 @@ WINS_StringToAddr (const char *string, struct qsockaddr *addr) sscanf (string, "%d.%d.%d.%d:%d", &ha1, &ha2, &ha3, &ha4, &hp); ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4; - addr->sa_family = AF_INET; + addr->qsa_family = AF_INET; ((struct sockaddr_in *) addr)->sin_addr.s_addr = htonl (ipaddr); ((struct sockaddr_in *) addr)->sin_port = htons ((unsigned short) hp); return 0; @@ -569,7 +569,7 @@ WINS_GetAddrFromName (const char *name, struct qsockaddr *addr) if (!hostentry) return -1; - addr->sa_family = AF_INET; + addr->qsa_family = AF_INET; ((struct sockaddr_in *) addr)->sin_port = htons ((unsigned short) net_hostport); ((struct sockaddr_in *) addr)->sin_addr.s_addr = @@ -583,7 +583,7 @@ WINS_GetAddrFromName (const char *name, struct qsockaddr *addr) int WINS_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2) { - if (addr1->sa_family != addr2->sa_family) + if (addr1->qsa_family != addr2->qsa_family) return -1; if (((struct sockaddr_in *) addr1)->sin_addr.s_addr !=