Add automatic strndup detection instead of the previous hack
This commit is contained in:
parent
aeb006beb6
commit
4c5038c26d
@ -63,6 +63,7 @@ if (MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_symbol_exists(memmem string.h HAVE_MEMMEM)
|
check_symbol_exists(memmem string.h HAVE_MEMMEM)
|
||||||
|
check_symbol_exists(strndup string.h HAVE_STRNDUP)
|
||||||
|
|
||||||
include_directories("${PROJECT_SOURCE_DIR}")
|
include_directories("${PROJECT_SOURCE_DIR}")
|
||||||
include_directories(${SQLITE3_INCLUDE_DIRS})
|
include_directories(${SQLITE3_INCLUDE_DIRS})
|
||||||
|
@ -79,13 +79,13 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#define HAVE_STRNDUP
|
|
||||||
#define HAVE_DLOPEN
|
#define HAVE_DLOPEN
|
||||||
#define HAVE_GETOPT
|
#define HAVE_GETOPT
|
||||||
#define HAVE_SSIZE_T
|
#define HAVE_SSIZE_T
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#define HAVE_GETRLIMIT
|
#define HAVE_GETRLIMIT
|
||||||
#endif
|
#endif
|
||||||
|
#cmakedefine HAVE_STRNDUP
|
||||||
#cmakedefine HAVE_MEMMEM
|
#cmakedefine HAVE_MEMMEM
|
||||||
|
|
||||||
/* printf support for size_t and uint64_t */
|
/* printf support for size_t and uint64_t */
|
||||||
@ -136,10 +136,6 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__)
|
|
||||||
#undef HAVE_STRNDUP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT
|
#ifdef HAVE_GETOPT
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user