From 736c95a870814f00031c75b2d4ad7af64a65918d Mon Sep 17 00:00:00 2001 From: R4SAS Date: Tue, 4 Jun 2019 23:23:59 +0300 Subject: [PATCH] [upnp] okay, lets do it other way... --- daemon/UPnP.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/daemon/UPnP.cpp b/daemon/UPnP.cpp index 31843816..15ec0cc5 100644 --- a/daemon/UPnP.cpp +++ b/daemon/UPnP.cpp @@ -81,10 +81,10 @@ namespace transport { bool isError; -#if MINIUPNPC_API_VERSION >= 8 +#if ((MINIUPNPC_API_VERSION >= 8) || defined (UPNPDISCOVER_SUCCESS)) int err = UPNPDISCOVER_SUCCESS; -#if MINIUPNPC_API_VERSION >= 14 +#if (MINIUPNPC_API_VERSION >= 14) m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, 2, &err); #else m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, &err); @@ -143,9 +143,9 @@ namespace transport { int err = UPNPCOMMAND_SUCCESS; -#if MINIUPNPC_API_VERSION >= 10 +#if (MINIUPNPC_API_VERSION >= 10) err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL, NULL); -#elif MINIUPNPC_API_VERSION >= 8 +#elif ((MINIUPNPC_API_VERSION >= 8) || defined (UPNPDISCOVER_SUCCESS)) err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL); #else err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL); @@ -181,7 +181,7 @@ namespace transport { LogPrint (eLogDebug, "UPnP: port ", strPort, " possible is not forwarded: return code ", err); -#if MINIUPNPC_API_VERSION >= 8 +#if ((MINIUPNPC_API_VERSION >= 8) || defined (UPNPDISCOVER_SUCCESS)) err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL, NULL); #else err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL);