engine: enable getaddrinfo on Windows, fix build

This commit is contained in:
Alibek Omarov 2022-03-11 12:51:58 +03:00
parent 5d18c6d678
commit b072b627a2
1 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,8 @@ GNU General Public License for more details.
#include <WS2tcpip.h>
typedef int WSAsize_t;
#define HAVE_GETADDRINFO
#elif !defined XASH_NO_NETWORK
// BSD sockets
#include <sys/types.h>
@ -381,7 +383,7 @@ qboolean NET_GetHostByName( const char *hostname, int family, struct sockaddr_st
return false;
((struct sockaddr_in *)addr)->sin_family = AF_INET;
((struct sockaddr_in *)addr)->sin_addr = *(in_addr *)h->h_addr_list[0];
((struct sockaddr_in *)addr)->sin_addr = *(struct in_addr *)h->h_addr_list[0];
return true;
#endif