From ef65f6c57afdff8eb86340de378ac038ff10e399 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 10:48:11 -0500 Subject: [PATCH] Support for both MiniUPNPC 2.0 and MiniUPNPC < 2.0 MiniUPNPC 2.0 was a backwards-incompatible change (as .0s tend to be) but configure detects them the same. This adds support for the changed functions. --- libretro-common/net/net_natt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 2bd7d1f865..851f5e5a65 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -50,7 +50,11 @@ void natt_init(void) int upnperror = 0; memset(&urls, 0, sizeof(struct UPNPUrls)); memset(&data, 0, sizeof(struct IGDdatas)); +#if MINIUPNPC_API_VERSION < 16 devlist = upnpDiscover(2000, NULL, NULL, 0, 0, &upnperror); +#else + devlist = upnpDiscover(2000, NULL, NULL, 0, 0, 2, &upnperror); +#endif if (devlist) { dev = devlist; @@ -63,7 +67,11 @@ void natt_init(void) if (!dev) dev = devlist; +#if MINIUPNPC_API_VERSION < 16 descXML = (char *) miniwget(dev->descURL, &descXMLsize, 0); +#else + descXML = (char *) miniwget(dev->descURL, &descXMLsize, 0, NULL); +#endif if (descXML) { parserootdesc (descXML, descXMLsize, &data);