MSVC 2005 Build Fix (#13401)

This commit is contained in:
Cthulhu-throwaway 2021-12-23 18:08:13 -03:00 committed by GitHub
parent c4049b9597
commit c6369b7861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -35,9 +35,11 @@
#include <net/net_natt.h>
#if !defined(_MSC_VER) || _MSC_VER > 1400
#if !defined(HAVE_SOCKET_LEGACY) && defined(_WIN32) && defined(IP_MULTICAST_IF)
#include <iphlpapi.h>
#endif
#endif
static natt_state_t natt_st = {{0}, {{0}}, 0, -1};
@ -56,8 +58,10 @@ bool natt_init(void)
"MX: 2\r\n"
"ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n";
static struct sockaddr_in msearch_addr = {0};
#if !defined(_MSC_VER) || _MSC_VER > 1400
#if defined(_WIN32) && defined(IP_MULTICAST_IF)
MIB_IPFORWARDROW ip_forward;
#endif
#endif
natt_state_t *st = &natt_st;
struct addrinfo *bind_addr = NULL;
@ -88,6 +92,7 @@ bool natt_init(void)
if (!bind_addr)
goto failure;
#if !defined(_MSC_VER) || _MSC_VER > 1400
#if defined(_WIN32) && defined(IP_MULTICAST_IF)
if (GetBestRoute(0xDFFFFFFF, 0, &ip_forward) == NO_ERROR)
{
@ -133,6 +138,7 @@ bool natt_init(void)
}
}
#endif
#endif
#ifdef IP_MULTICAST_TTL
{

View File

@ -41,9 +41,11 @@
#include <string/stdstring.h>
#include <file/file_path.h>
#if !defined(_MSC_VER) || _MSC_VER > 1400
#if defined(_WIN32) && defined(IP_MULTICAST_IF)
#include <iphlpapi.h>
#endif
#endif
#ifdef HAVE_DISCORD
#include "../discord.h"
@ -244,6 +246,7 @@ bool init_netplay_discovery(void)
if (ret)
{
#if !defined(_MSC_VER) || _MSC_VER > 1400
#if defined(_WIN32) && defined(IP_MULTICAST_IF)
MIB_IPFORWARDROW ip_forward;
@ -291,6 +294,7 @@ bool init_netplay_discovery(void)
}
}
#endif
#endif
#if defined(SOL_SOCKET) && defined(SO_BROADCAST)
/* Make it broadcastable */