winpr: fix build on Windows with unit tests

This commit is contained in:
Marc-André Moreau 2014-07-17 12:02:47 -04:00
parent 0fb3bf1dfd
commit 4f4603133e
6 changed files with 16 additions and 2 deletions

View File

@ -33,6 +33,6 @@ set(${MODULE_PREFIX}_SRCS
winpr_module_add(${${MODULE_PREFIX}_SRCS})
if(BUILD_TESTING)
if(BUILD_TESTING AND UNIX AND NOT WIN32)
add_subdirectory(test)
endif()

View File

@ -90,9 +90,10 @@ int TestGetCommState(int argc, char* argv[])
return EXIT_FAILURE;
}
hComm = CreateFile("COM1",
hComm = CreateFileA("COM1",
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
if (hComm == INVALID_HANDLE_VALUE)
{
printf("CreateFileA failure: 0x%x\n", GetLastError());

View File

@ -19,7 +19,10 @@
#include <stdio.h>
#include <sys/stat.h>
#ifndef _WIN32
#include <termios.h>
#endif
#include <winpr/comm.h>
#include <winpr/crt.h>

View File

@ -19,7 +19,10 @@
#include <stdio.h>
#include <sys/stat.h>
#ifndef _WIN32
#include <termios.h>
#endif
#include <winpr/comm.h>
#include <winpr/crt.h>

View File

@ -19,7 +19,10 @@
#include <stdio.h>
#include <sys/stat.h>
#ifndef _WIN32
#include <termios.h>
#endif
#include <winpr/comm.h>
#include <winpr/crt.h>

View File

@ -20,6 +20,10 @@ winpr_module_add(
crypto.h
cert.c)
if(WIN32)
winpr_library_add(crypt32)
endif()
if(BUILD_TESTING)
add_subdirectory(test)
endif()