diff --git a/src/darwintracelib1.0/darwintrace.c b/src/darwintracelib1.0/darwintrace.c index 71ba17e1de..a4f81bf79b 100644 --- a/src/darwintracelib1.0/darwintrace.c +++ b/src/darwintracelib1.0/darwintrace.c @@ -36,6 +36,7 @@ #define DARWINTRACE_USE_PRIVATE_API 1 #include "darwintrace.h" #include "sandbox_actions.h" +#include "strlcpy.h" #ifdef HAVE_STDATOMIC_H #include diff --git a/src/darwintracelib1.0/readdir.c b/src/darwintracelib1.0/readdir.c index e413e6775f..660a883967 100644 --- a/src/darwintracelib1.0/readdir.c +++ b/src/darwintracelib1.0/readdir.c @@ -34,6 +34,7 @@ */ #include "darwintrace.h" +#include "strlcat.h" #include #include diff --git a/src/machista1.0/Makefile.in b/src/machista1.0/Makefile.in index e1abb26a36..61a612f97c 100644 --- a/src/machista1.0/Makefile.in +++ b/src/machista1.0/Makefile.in @@ -7,6 +7,11 @@ OBJS= libmachista.o hashmap.o machista_wrap.o SHLIB_NAME= machista${SHLIB_SUFFIX} INSTALLDIR= ${TCL_PACKAGE_PATH}/machista1.0 +CPPFLAGS+= -I$(srcdir)/../compat +ifneq ($(HAVE_STRLCAT),yes) +OBJS+= ../compat/strlcat.o +endif + SWIG = @SWIG@ SWIG_FLAGS = -tcl8 -pkgversion 1.0 -namespace SWIG_LDFLAGS = -ltcl diff --git a/src/machista1.0/libmachista.c b/src/machista1.0/libmachista.c index cead31c4cb..016f794019 100644 --- a/src/machista1.0/libmachista.c +++ b/src/machista1.0/libmachista.c @@ -61,6 +61,7 @@ #include "libmachista.h" #include "hashmap.h" +#include "strlcpy.h" #ifdef __MACH__ /* Tiger compatibility */ diff --git a/src/pextlib1.0/sip_copy_proc.c b/src/pextlib1.0/sip_copy_proc.c index 61e1eab25b..10aa5df86a 100644 --- a/src/pextlib1.0/sip_copy_proc.c +++ b/src/pextlib1.0/sip_copy_proc.c @@ -52,6 +52,8 @@ #include #endif +#include "getline.h" + #include "sip_copy_proc.h" #ifndef DARWINTRACE_SIP_WORKAROUND_PATH diff --git a/src/pextlib1.0/tracelib.c b/src/pextlib1.0/tracelib.c index b67d5a937f..410356349e 100644 --- a/src/pextlib1.0/tracelib.c +++ b/src/pextlib1.0/tracelib.c @@ -71,24 +71,9 @@ #include "Pextlib.h" #include "strlcat.h" +#include "strlcpy.h" #ifdef HAVE_TRACEMODE_SUPPORT -#ifndef HAVE_STRLCPY -/* Define strlcpy if it's not available. */ -size_t strlcpy(char *dst, const char *src, size_t size); -size_t strlcpy(char *dst, const char *src, size_t size) { - size_t result = strlen(src); - if (size > 0) { - size_t copylen = size - 1; - if (copylen > result) { - copylen = result; - } - memcpy(dst, src, copylen); - dst[copylen] = 0; - } - return result; -} -#endif #ifdef HAVE_PEERPID_LIST static bool peerpid_list_enqueue(int sock, pid_t pid);