From 01eab0fba591e145621c595127a970a9024348f5 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sun, 19 Jun 2022 18:32:26 +0200 Subject: [PATCH] (3DS/CTR) Take out HAVE_SOCKET_LEGACY for 3DS as per Cthulhu recommendation and instead put in the extra conditional for natt.c and netplay_frontend.c --- Makefile.ctr | 4 ++-- network/natt.c | 6 +++++- network/netplay/netplay_frontend.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile.ctr b/Makefile.ctr index eb60373dc9..c02a25948e 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -63,7 +63,7 @@ ifeq ($(GRIFFIN_BUILD), 1) DEFINES += -DHAVE_GFX_WIDGETS DEFINES += -DHAVE_OVERLAY DEFINES += -DHAVE_CORE_INFO_CACHE - DEFINES += -DHAVE_SOCKET_LEGACY + #DEFINES += -DHAVE_SOCKET_LEGACY #-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL #ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file else @@ -90,7 +90,7 @@ else HAVE_RWAV = 1 #HAVE_NETWORKING = 1 #HAVE_CHEEVOS = 1 - HAVE_SOCKET_LEGACY = 1 + #HAVE_SOCKET_LEGACY = 1 HAVE_THREADS = 1 #HAVE_SSL = 1 #HAVE_BUILTINMBEDTLS = 1 diff --git a/network/natt.c b/network/natt.c index 91c7f08c6b..309208e299 100644 --- a/network/natt.c +++ b/network/natt.c @@ -30,6 +30,10 @@ #include "natt.h" +#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY) && !defined(_3DS) +#define HAVE_INET6 1 +#endif + static bool translate_addr(struct sockaddr_in *addr, char *host, size_t hostlen, char *port, size_t portlen) { @@ -67,7 +71,7 @@ static bool translate_addr(struct sockaddr_in *addr, static bool addr_6to4(struct sockaddr_storage *addr) { -#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY) +#if defined(HAVE_INET6) /* ::ffff:a.b.c.d */ static const uint16_t preffix[] = {0,0,0,0,0,0xffff}; uint32_t address; diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index ad98cdeb34..1aee1dcdfe 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -78,7 +78,7 @@ #include "netplay_private.h" -#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY) +#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY) && !defined(_3DS) #define HAVE_INET6 1 #endif