Replace platform ISC_PLATFORM_NEEDSTRLCPY and ISC_PLATFORM_NEEDSTRLCAT with AC_CHECK_FUNCS call

This commit is contained in:
Ondřej Surý
2018-09-04 21:10:02 +02:00
parent 4014bc42dd
commit 47f18c7d50
7 changed files with 28 additions and 49 deletions

View File

@@ -49,8 +49,9 @@
#include "isc/string.h" // IWYU pragma: keep
#if !defined(HAVE_STRLCPY)
size_t
isc_string_strlcpy(char *dst, const char *src, size_t size)
strlcpy(char *dst, const char *src, size_t size)
{
char *d = dst;
const char *s = src;
@@ -76,9 +77,11 @@ isc_string_strlcpy(char *dst, const char *src, size_t size)
return(s - src - 1); /* count does not include NUL */
}
#endif /* !defined(HAVE_STRLCPY) */
#if !defined(HAVE_STRLCAT)
size_t
isc_string_strlcat(char *dst, const char *src, size_t size)
strlcat(char *dst, const char *src, size_t size)
{
char *d = dst;
const char *s = src;
@@ -106,6 +109,7 @@ isc_string_strlcat(char *dst, const char *src, size_t size)
return(dlen + (s - src)); /* count does not include NUL */
}
#endif /* !defined(HAVE_STRLCAT) */
int
isc_string_strerror_r(int errnum, char *buf, size_t buflen) {