mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	fix upnp definitions and make cmake silent (#999)
This commit is contained in:
		
							parent
							
								
									20e484bb8b
								
							
						
					
					
						commit
						100f3380c4
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -150,7 +150,7 @@ else()
 | 
			
		|||
  if (MSYS OR MINGW)
 | 
			
		||||
    add_definitions( -DWIN32_LEAN_AND_MEAN )
 | 
			
		||||
  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" )
 | 
			
		||||
  # TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
 | 
			
		||||
  # 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")
 | 
			
		||||
  # more tweaks
 | 
			
		||||
  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 ()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ namespace transport
 | 
			
		|||
#if MINIUPNPC_API_VERSION >= 14
 | 
			
		||||
		int nerror = 0;
 | 
			
		||||
		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;
 | 
			
		||||
		m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
 | 
			
		||||
#else
 | 
			
		||||
| 
						 | 
				
			
			@ -158,7 +158,7 @@ namespace transport
 | 
			
		|||
		std::string strType (GetProto (address)), strPort (std::to_string (address->port));
 | 
			
		||||
		int r;
 | 
			
		||||
		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");
 | 
			
		||||
#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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -165,7 +165,7 @@ namespace log {
 | 
			
		|||
		while (m_IsRunning)
 | 
			
		||||
		{
 | 
			
		||||
			std::shared_ptr<LogMsg> msg;
 | 
			
		||||
			while (msg = m_Queue.Get ())
 | 
			
		||||
			while ((msg = m_Queue.Get ()))
 | 
			
		||||
				Process (msg);
 | 
			
		||||
			if (m_LogStream) m_LogStream->flush();
 | 
			
		||||
			if (m_IsRunning)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue