diff --git a/CMakeLists.txt b/CMakeLists.txt index cfb50d9..033a953 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/system.h.in b/src/system.h.in index ebd7dd9..0675912 100644 --- a/src/system.h.in +++ b/src/system.h.in @@ -79,13 +79,13 @@ #include #include #include -#define HAVE_STRNDUP #define HAVE_DLOPEN #define HAVE_GETOPT #define HAVE_SSIZE_T #include #define HAVE_GETRLIMIT #endif +#cmakedefine HAVE_STRNDUP #cmakedefine HAVE_MEMMEM /* printf support for size_t and uint64_t */ @@ -136,10 +136,6 @@ #include #endif -#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__) -#undef HAVE_STRNDUP -#endif - #ifdef HAVE_GETOPT #include #endif