Add automatic strndup detection instead of the previous hack

This commit is contained in:
klondike 2013-08-31 16:00:18 +02:00 committed by Jan Vidar Krey
parent aeb006beb6
commit 4c5038c26d
2 changed files with 2 additions and 5 deletions

View File

@ -63,6 +63,7 @@ if (MSVC)
endif()
check_symbol_exists(memmem string.h HAVE_MEMMEM)
check_symbol_exists(strndup string.h HAVE_STRNDUP)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories(${SQLITE3_INCLUDE_DIRS})

View File

@ -79,13 +79,13 @@
#include <grp.h>
#include <pwd.h>
#include <sys/resource.h>
#define HAVE_STRNDUP
#define HAVE_DLOPEN
#define HAVE_GETOPT
#define HAVE_SSIZE_T
#include <dlfcn.h>
#define HAVE_GETRLIMIT
#endif
#cmakedefine HAVE_STRNDUP
#cmakedefine HAVE_MEMMEM
/* printf support for size_t and uint64_t */
@ -136,10 +136,6 @@
#include <sys/select.h>
#endif
#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__)
#undef HAVE_STRNDUP
#endif
#ifdef HAVE_GETOPT
#include <getopt.h>
#endif