mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
fix upnp definitions and make cmake silent (#999)
This commit is contained in:
parent
20e484bb8b
commit
100f3380c4
|
@ -150,7 +150,7 @@ else()
|
||||||
if (MSYS OR MINGW)
|
if (MSYS OR MINGW)
|
||||||
add_definitions( -DWIN32_LEAN_AND_MEAN )
|
add_definitions( -DWIN32_LEAN_AND_MEAN )
|
||||||
endif ()
|
endif ()
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wno-unused-parameter" )
|
||||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic" )
|
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic" )
|
||||||
# TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
|
# TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
|
||||||
# Multiple definitions of __stack_chk_fail (libssp & libc)
|
# Multiple definitions of __stack_chk_fail (libssp & libc)
|
||||||
|
@ -180,7 +180,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# more tweaks
|
# more tweaks
|
||||||
if (NOT (MSVC OR MSYS OR APPLE))
|
if (NOT (MSVC OR MSYS OR APPLE))
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++" )
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-const-variable -Wno-overloaded-virtual -Wno-c99-extensions -stdlib=libstdc++" )
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace transport
|
||||||
#if MINIUPNPC_API_VERSION >= 14
|
#if MINIUPNPC_API_VERSION >= 14
|
||||||
int nerror = 0;
|
int nerror = 0;
|
||||||
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror);
|
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror);
|
||||||
#elif MINIUPNPC_API_VERSION >= 8
|
#elif ( MINIUPNPC_API_VERSION >= 8 || defined(UPNPDISCOVER_SUCCESS) )
|
||||||
int nerror = 0;
|
int nerror = 0;
|
||||||
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
|
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
|
||||||
#else
|
#else
|
||||||
|
@ -158,7 +158,7 @@ namespace transport
|
||||||
std::string strType (GetProto (address)), strPort (std::to_string (address->port));
|
std::string strType (GetProto (address)), strPort (std::to_string (address->port));
|
||||||
int r;
|
int r;
|
||||||
std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
|
std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
|
||||||
#if MINIUPNPC_API_VERSION >= 8
|
#ifdef UPNPDISCOVER_SUCCESS
|
||||||
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
|
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
|
||||||
#else
|
#else
|
||||||
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0);
|
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0);
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace log {
|
||||||
while (m_IsRunning)
|
while (m_IsRunning)
|
||||||
{
|
{
|
||||||
std::shared_ptr<LogMsg> msg;
|
std::shared_ptr<LogMsg> msg;
|
||||||
while (msg = m_Queue.Get ())
|
while ((msg = m_Queue.Get ()))
|
||||||
Process (msg);
|
Process (msg);
|
||||||
if (m_LogStream) m_LogStream->flush();
|
if (m_LogStream) m_LogStream->flush();
|
||||||
if (m_IsRunning)
|
if (m_IsRunning)
|
||||||
|
|
Loading…
Reference in a new issue