Detect writev, pwritev, readv, preadv functions.

This commit is contained in:
Jan Vidar Krey 2014-12-15 11:31:23 +01:00
parent dc80644471
commit 71cdf158e4
2 changed files with 18 additions and 2 deletions

View File

@ -26,7 +26,8 @@ find_package(Git)
find_package(Sqlite3)
include(TestBigEndian)
include(CheckSymbolExists)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckTypeSize)
@ -69,9 +70,19 @@ check_include_file(sys/types.h HAVE_SYS_TYPES_H)
if (HAVE_SYS_TYPES_H)
set (CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "sys/types.h")
endif()
check_type_size( ssize_t SSIZE_T )
check_include_file(sys/uio.h HAVE_SYS_UIO_H)
if (HAVE_SYS_UIO_H)
set (CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "sys/uio.h")
endif()
check_type_size(ssize_t SSIZE_T)
check_symbol_exists(memmem string.h HAVE_MEMMEM)
check_symbol_exists(strndup string.h HAVE_STRNDUP)
check_function_exists(writev HAVE_FUNC_WRITEV)
check_function_exists(pwritev HAVE_FUNC_PWRITEV)
check_function_exists(readv HAVE_FUNC_WRITEV)
check_function_exists(preadv HAVE_FUNC_PWRITEV)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories(${SQLITE3_INCLUDE_DIRS})

View File

@ -88,6 +88,11 @@
#cmakedefine HAVE_STRNDUP
#cmakedefine HAVE_MEMMEM
#cmakedefine HAVE_SYS_UIO_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/uio.h>
#endif
/* printf support for size_t and uint64_t */
#if defined(WIN32)
#define PRINTF_SIZE_T "%Iu"