From 7634b1bbb01d6704354f3efb6acd63fac0cdb9fb Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Sat, 1 Sep 2018 21:14:56 -0400 Subject: [PATCH] Fix netplay on Wii U getaddrinfo on Wii U doesn't support node==NULL. As I don't know of this bug on any other platform, I've made a Wii-U-specific workaround in getaddrinfo_retro. --- libretro-common/net/net_compat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libretro-common/net/net_compat.c b/libretro-common/net/net_compat.c index 86c1381221..ea45743596 100644 --- a/libretro-common/net/net_compat.c +++ b/libretro-common/net/net_compat.c @@ -183,6 +183,16 @@ int getaddrinfo_retro(const char *node, const char *service, #endif } +#if defined(WIIU) + if (node == NULL) { + /* Wii U's socket library chokes on NULL node */ + if (hints->ai_flags & AI_PASSIVE) + node = "0.0.0.0"; + else + node = "127.0.0.1"; + } +#endif + #ifdef HAVE_SOCKET_LEGACY info = (struct addrinfo*)calloc(1, sizeof(*info)); if (!info)