/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
/* Define to 1 if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H
DST_EXTRA_OBJS
USE_ISC_SPNEGO
READLINE_LIB
-ISC_PLATFORM_NEEDSTRLCAT
-ISC_PLATFORM_NEEDSTRLCPY
ISC_PLATFORM_HAVETFO
BIND9_CO_RULE
LIBTOOL_MODE_UNINSTALL
#
# Check for some other useful functions that are not ever-present.
#
-ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
-if test "x$ac_cv_func_strlcpy" = xyes; then :
- ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"
-else
- ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"
-fi
-
-
+for ac_func in strlcpy strlcat
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
-if test "x$ac_cv_func_strlcat" = xyes; then :
- ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"
-else
- ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"
fi
-
+done
#
# Check for some other useful functions that are not ever-present.
#
-AC_CHECK_FUNC(strlcpy,
- [ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
- [ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
-AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
-
-AC_CHECK_FUNC(strlcat,
- [ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
- [ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
-AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
+AC_CHECK_FUNCS([strlcpy strlcat])
AC_SUBST(READLINE_LIB)
AC_ARG_WITH(readline,
*/
@ISC_PLATFORM_HAVEDEVPOLL@
-/*
- *** Printing.
- ***/
-
-/*
- * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
- */
-@ISC_PLATFORM_NEEDSTRLCAT@
-
/***
*** Miscellaneous.
***/
ISC_LANG_BEGINDECLS
+#if !defined(HAVE_STRLCPY)
size_t
-isc_string_strlcpy(char *dst, const char *src, size_t size);
-
-#ifdef ISC_PLATFORM_NEEDSTRLCPY
-#define strlcpy isc_string_strlcpy
-#endif
+strlcpy(char *dst, const char *src, size_t size);
+#endif /* !defined(HAVE_STRLCPY) */
+#if !defined(HAVE_STRLCAT)
size_t
-isc_string_strlcat(char *dst, const char *src, size_t size);
-
-#ifdef ISC_PLATFORM_NEEDSTRLCAT
-#define strlcat isc_string_strlcat
+strlcat(char *dst, const char *src, size_t size);
#endif
int
#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;
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;
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) {
#undef MSG_TRUNC
-#define ISC_PLATFORM_NEEDSTRLCPY
-#define ISC_PLATFORM_NEEDSTRLCAT
-
/*
* Used to control how extern data is linked; needed for Win32 platforms.
*/