From 71cdf158e41b1c0738c3b389860c5e4ffe1d30ae Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Mon, 15 Dec 2014 11:31:23 +0100 Subject: [PATCH] Detect writev, pwritev, readv, preadv functions. --- CMakeLists.txt | 15 +++++++++++++-- src/system.h.in | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f3941d..ab8c322 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/system.h.in b/src/system.h.in index dce1892..e9e9c42 100644 --- a/src/system.h.in +++ b/src/system.h.in @@ -88,6 +88,11 @@ #cmakedefine HAVE_STRNDUP #cmakedefine HAVE_MEMMEM +#cmakedefine HAVE_SYS_UIO_H +#ifdef HAVE_SYS_TYPES_H +#include +#endif + /* printf support for size_t and uint64_t */ #if defined(WIN32) #define PRINTF_SIZE_T "%Iu"