diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index f64f5bca..a233c9ad 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -18,16 +18,16 @@ GNU General Public License for more details. #include "netchan.h" #include "xash3d_mathlib.h" #include "ipv6text.h" -#if XASH_WIN32 -#include "platform/win32/net.h" -#elif defined XASH_NO_NETWORK + +#if XASH_NO_NETWORK #include "platform/stub/net_stub.h" -#else -#include "platform/posix/net.h" -#endif -#if XASH_PSVITA +#elif XASH_WIN32 +#include "platform/win32/net.h" +#elif XASH_PSVITA #include "platform/psvita/net_psvita.h" static const struct in6_addr in6addr_any; +#else +#include "platform/posix/net.h" #endif #if XASH_SDL == 2 @@ -329,6 +329,11 @@ static qboolean NET_GetHostByName( const char *hostname, int family, struct sock struct addrinfo hints; qboolean ret = false; +#if XASH_NO_IPV6_RESOLVE + if( family == AF_INET6 ) + return false; +#endif + memset( &hints, 0, sizeof( hints )); hints.ai_family = family; @@ -351,6 +356,12 @@ static qboolean NET_GetHostByName( const char *hostname, int family, struct sock return ret; #else struct hostent *h; + +#if XASH_NO_IPV6_RESOLVE + if( family == AF_INET6 ) + return false; +#endif + if(!( h = gethostbyname( hostname ))) return false; diff --git a/engine/platform/psvita/net_psvita.h b/engine/platform/psvita/net_psvita.h index 4f111604..5684a6ae 100644 --- a/engine/platform/psvita/net_psvita.h +++ b/engine/platform/psvita/net_psvita.h @@ -18,8 +18,10 @@ GNU General Public License for more details. #define NET_PSVITA_H #include +#include "platform/posix/net.h" /* we're missing IPv6 support; define some trash */ +#define XASH_NO_IPV6_RESOLVE 1 #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED( p ) ( 0 )