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.
This commit is contained in:
Gregor Richards 2018-09-01 21:14:56 -04:00
parent 4f4b1c182f
commit 7634b1bbb0

View File

@ -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)