Changeset - f68020a6ba08
[Not reviewed]
0 3 0
Vitaly Takmazov - 13 years ago 2012-05-22 10:28:26
vitalyster@gmail.com
Fixed compilation of swiften plugin for win32
3 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
backends/CMakeLists.txt
Show inline comments
 
@@ -7,8 +7,6 @@ if (PROTOBUF_FOUND)
 
		ADD_SUBDIRECTORY(libcommuni)
 
	endif()
 

	
 
	ADD_SUBDIRECTORY(smstools3)
 

	
 
	ADD_SUBDIRECTORY(swiften)
 

	
 
	ADD_SUBDIRECTORY(template)
backends/swiften/CMakeLists.txt
Show inline comments
 
@@ -4,7 +4,11 @@ FILE(GLOB SRC *.cpp)
 
 
ADD_EXECUTABLE(spectrum2_swiften_backend ${SRC})
 
 
IF (NOT WIN32)
 
target_link_libraries(spectrum2_swiften_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
 
else()
 
target_link_libraries(spectrum2_swiften_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
 
endif()
 
 
INSTALL(TARGETS spectrum2_swiften_backend RUNTIME DESTINATION bin)
 
backends/swiften/main.cpp
Show inline comments
 
@@ -6,11 +6,13 @@
 
// Swiften
 
#include "Swiften/Swiften.h"
 

	
 
#ifndef WIN32
 
// for signal handler
 
#include "unistd.h"
 
#include "signal.h"
 
#include "sys/wait.h"
 
#include "sys/signal.h"
 
#endif
 

	
 
// malloc_trim
 
#include "malloc.h"
 
@@ -231,6 +233,7 @@ class SwiftenPlugin : public NetworkPlugin {
 
		std::map<std::string, boost::shared_ptr<Swift::Client> > m_users;
 
};
 

	
 
#ifndef WIN32
 
static void spectrum_sigchld_handler(int sig)
 
{
 
	int status;
 
@@ -246,16 +249,19 @@ static void spectrum_sigchld_handler(int sig)
 
		perror(errmsg);
 
	}
 
}
 
#endif
 

	
 

	
 
int main (int argc, char* argv[]) {
 
	std::string host;
 
	int port;
 

	
 
#ifndef WIN32
 
	if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {
 
		std::cout << "SIGCHLD handler can't be set\n";
 
		return -1;
 
	}
 
#endif
 

	
 
	boost::program_options::options_description desc("Usage: spectrum [OPTIONS] <config_file.cfg>\nAllowed options");
 
	desc.add_options()
0 comments (0 inline, 0 general)