Check for ssize_t properly
This commit is contained in:
parent
5c8d99d8ff
commit
b8209d9d0a
@ -27,6 +27,8 @@ find_package(Sqlite3)
|
||||
|
||||
include(TestBigEndian)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckTypeSize)
|
||||
|
||||
#Some functions need this to be found
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
@ -62,6 +64,11 @@ if (MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
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_symbol_exists(memmem string.h HAVE_MEMMEM)
|
||||
check_symbol_exists(strndup string.h HAVE_STRNDUP)
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
#define HAVE_SSIZE_T
|
||||
#define NEED_GETOPT
|
||||
#endif
|
||||
|
||||
@ -69,6 +68,10 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#cmakedefine HAVE_SYS_TYPES_H
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if !defined(WIN32)
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
@ -77,10 +80,10 @@
|
||||
#include <sys/resource.h>
|
||||
#define HAVE_DLOPEN
|
||||
#define HAVE_GETOPT
|
||||
#define HAVE_SSIZE_T
|
||||
#include <dlfcn.h>
|
||||
#define HAVE_GETRLIMIT
|
||||
#endif
|
||||
#cmakedefine HAVE_SSIZE_T
|
||||
#cmakedefine HAVE_STRNDUP
|
||||
#cmakedefine HAVE_MEMMEM
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user