From c6369b7861dae79d160c3243d9ba50396be6147f Mon Sep 17 00:00:00 2001 From: Cthulhu-throwaway <96153783+Cthulhu-throwaway@users.noreply.github.com> Date: Thu, 23 Dec 2021 18:08:13 -0300 Subject: [PATCH] MSVC 2005 Build Fix (#13401) --- libretro-common/net/net_natt.c | 6 ++++++ network/netplay/netplay_frontend.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index fa022808d2..9d5144f9d2 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -35,9 +35,11 @@ #include +#if !defined(_MSC_VER) || _MSC_VER > 1400 #if !defined(HAVE_SOCKET_LEGACY) && defined(_WIN32) && defined(IP_MULTICAST_IF) #include #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 { diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index c91b03438f..1d0a7e37ad 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -41,9 +41,11 @@ #include #include +#if !defined(_MSC_VER) || _MSC_VER > 1400 #if defined(_WIN32) && defined(IP_MULTICAST_IF) #include #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 */