Merge pull request #3708 from ismail/miniupnpc-api-16

Fix build with MINIUPNPC_API_VERSION >= 16
This commit is contained in:
Pierre Bourdon 2016-03-07 13:49:26 +01:00
commit 370e91d4c0
1 changed files with 13 additions and 2 deletions

View File

@ -942,8 +942,14 @@ bool NetPlayServer::initUPnP()
for (const UPNPDev* dev : igds)
{
char* descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0);
if (descXML)
char* descXML;
int statusCode = 200;
#if MINIUPNPC_API_VERSION >= 16
descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0, &statusCode);
#else
descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0);
#endif
if (descXML && (statusCode == 200))
{
parserootdesc(descXML, descXMLsize, &m_upnp_data);
free(descXML);
@ -955,6 +961,11 @@ bool NetPlayServer::initUPnP()
}
else
{
if (descXML)
{
free(descXML);
descXML = nullptr;
}
WARN_LOG(NETPLAY, "Error getting info from IGD at %s.", dev->descURL);
}
}