diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-09 15:43:08 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-09 15:43:08 +0000 |
commit | b79df1dc29c5ca3181be3e6e642f6c51e951e34e (patch) | |
tree | 8740f7765aeccd4559cc62f34f76094dc8853da1 /configure.ac | |
parent | 180ebf02081087eec625a25c785985f5d6b5eff4 (diff) |
Compat code for strndup and strnlen.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 79dfcb31..67ff2d23 100644 --- a/configure.ac +++ b/configure.ac @@ -423,6 +423,20 @@ if test "x$found_strlcat" = xyes; then fi AM_CONDITIONAL(NO_STRLCAT, [test "x$found_strlcat" = xno]) +# Look for strnlen, compat/strnlen.c used if missing. +AC_CHECK_FUNC(strnlen, found_strnlen=yes, found_strnlen=no) +if test "x$found_strnlen" = xyes; then + AC_DEFINE(HAVE_STRNLEN) +fi +AM_CONDITIONAL(NO_STRNLEN, [test "x$found_strnlen" = xno]) + +# Look for strndup, compat/strndup.c used if missing. +AC_CHECK_FUNC(strndup, found_strndup=yes, found_strndup=no) +if test "x$found_strndup" = xyes; then + AC_DEFINE(HAVE_STRNDUP) +fi +AM_CONDITIONAL(NO_STRNDUP, [test "x$found_strndup" = xno]) + # Look for asprintf, compat/asprintf.c used if missing. AC_CHECK_FUNC(asprintf, found_asprintf=yes, found_asprintf=no) if test "x$found_asprintf" = xyes; then |