fixed checking for strlcat/strlcpy

newer clang uses a definition rather than a function
This commit is contained in:
Frank Morgner 2020-04-09 17:20:54 +02:00
parent e71b85867f
commit 178c4a9eaa
5 changed files with 10 additions and 5 deletions

View File

@ -417,8 +417,9 @@ AC_FUNC_VPRINTF
AC_CHECK_FUNCS([ \ AC_CHECK_FUNCS([ \
getpass gettimeofday getline memset mkdir \ getpass gettimeofday getline memset mkdir \
strdup strerror memset_s explicit_bzero \ strdup strerror memset_s explicit_bzero \
strlcpy strlcat strnlen sigaction strnlen sigaction
]) ])
AC_CHECK_DECLS([strlcpy, strlcat], [], [], [[#include <string.h>]])
AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(void *)
if test "${ac_cv_sizeof_void_p}" = 8; then if test "${ac_cv_sizeof_void_p}" = 8; then
LIBRARY_BITNESS="64" LIBRARY_BITNESS="64"

View File

@ -31,7 +31,7 @@
#include "config.h" #include "config.h"
#endif #endif
#ifndef HAVE_STRLCAT #if !defined(HAVE_DECL_STRLCAT) || !HAVE_DECL_STRLCAT
#include <sys/types.h> #include <sys/types.h>
#include <string.h> #include <string.h>

View File

@ -10,9 +10,11 @@
#include "config.h" #include "config.h"
#endif #endif
#ifndef HAVE_STRLCAT #if !defined(HAVE_DECL_STRLCAT) || !HAVE_DECL_STRLCAT
#include <stddef.h> #include <stddef.h>
size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz);
#else
#include <string.h>
#endif #endif
#endif #endif

View File

@ -20,7 +20,7 @@
#include "config.h" #include "config.h"
#endif #endif
#ifndef HAVE_STRLCPY /* empty file if strlcpy is available */ #if !defined(HAVE_DECL_STRLCPY) || !HAVE_DECL_STRLCPY
#include <sys/types.h> #include <sys/types.h>
#include <string.h> #include <string.h>

View File

@ -38,9 +38,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "config.h" #include "config.h"
#endif #endif
#ifndef HAVE_STRLCPY #if !defined(HAVE_DECL_STRLCPY) || !HAVE_DECL_STRLCPY
#include <stddef.h> #include <stddef.h>
size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz);
#else
#include <string.h>
#endif #endif
#endif #endif