Make sgio tests friendly to Windows.
This commit is contained in:
parent
b5a4a55370
commit
3a210d6fa6
@ -162,6 +162,8 @@ if(WIN32)
|
||||
|
||||
# assumed on Windows
|
||||
set(HAVE_GETLOCALTIME 1)
|
||||
|
||||
set( WINSOCK_LIBRARY "ws2_32.lib" )
|
||||
endif(WIN32)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS}")
|
||||
|
@ -39,12 +39,14 @@ simgear_component(io io "${SOURCES}" "${HEADERS}")
|
||||
add_executable(test_sock socktest.cxx)
|
||||
target_link_libraries(test_sock sgio sgstructure sgthreads sgdebug
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${WINSOCK_LIBRARY}
|
||||
${RT_LIBRARY})
|
||||
|
||||
add_executable(test_http test_HTTP.cxx)
|
||||
target_link_libraries(test_http
|
||||
sgio sgstructure sgthreads sgtiming sgmisc sgdebug
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${WINSOCK_LIBRARY}
|
||||
${RT_LIBRARY})
|
||||
|
||||
add_test(http ${EXECUTABLE_OUTPUT_PATH}/test_http)
|
||||
@ -53,4 +55,5 @@ add_executable(httpget httpget.cxx)
|
||||
target_link_libraries(httpget
|
||||
sgio sgstructure sgthreads sgtiming sgmisc sgdebug
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${WINSOCK_LIBRARY}
|
||||
${RT_LIBRARY})
|
||||
|
@ -1,11 +1,11 @@
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <signal.h>
|
||||
|
||||
#include <unistd.h> // for STDOUT_FILENO
|
||||
#include <iostream>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#include <simgear/io/sg_file.hxx>
|
||||
#include <simgear/io/HTTPClient.hxx>
|
||||
@ -136,7 +136,7 @@ int main(int argc, char* argv[])
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if (!outFile) {
|
||||
outFile = new SGFile(STDOUT_FILENO);
|
||||
outFile = new SGFile(fileno(stdout));
|
||||
}
|
||||
|
||||
if (url.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user