From 8e946b92b78633955cf23a2f79cbdeaa330a22eb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 14 Jan 2015 09:48:39 +0100 Subject: [PATCH] Fix compilation on OS X Yosemite Due to our unconditional declaration of the strlcat and strlcpy functions, compilation failed on OS X Yosemite. Bug #1192 --- configure.ac | 1 + src/suricata-common.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 48fcad47c3..fb4dfefe70 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,7 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strdup strerror strncasecmp strtol strtoul memchr memrchr]) + AC_CHECK_FUNCS([strlcpy strlcat]) # Add large file support AC_SYS_LARGEFILE diff --git a/src/suricata-common.h b/src/suricata-common.h index 43c76c19f7..9aafa7aa35 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -323,8 +323,12 @@ typedef enum PacketProfileDetectId_ { #include "util-path.h" #include "util-conf.h" +#ifndef HAVE_STRLCAT size_t strlcat(char *, const char *src, size_t siz); +#endif +#ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); +#endif extern int coverage_unittests; extern int g_ut_modules;