Provide getdelim and getline compat shims

These are portable implementations from NetBSD that are needed on
Windows and perhaps some other platforms with the new versions of
the mlkem tests.
This commit is contained in:
Theo Buehler
2024-12-19 20:24:33 +01:00
parent c8bb011470
commit bf808ea0fc
8 changed files with 163 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ AC_CHECK_HEADERS([netinet/ip.h], [], [],
])
AC_HEADER_RESOLV
# Check for general libc functions
AC_CHECK_FUNCS([asprintf freezero memmem])
AC_CHECK_FUNCS([asprintf freezero getdelim getline memmem])
AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray])
AC_CHECK_FUNCS([strcasecmp strlcat strlcpy strndup strnlen strsep strtonum])
AC_CHECK_FUNCS([timegm _mkgmtime timespecsub])
@@ -24,6 +24,8 @@ AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [
])
AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
AM_CONDITIONAL([HAVE_FREEZERO], [test "x$ac_cv_func_freezero" = xyes])
AM_CONDITIONAL([HAVE_GETDELIM], [test "x$ac_cv_func_getdelim" = xyes])
AM_CONDITIONAL([HAVE_GETLINE], [test "x$ac_cv_func_getline" = xyes])
AM_CONDITIONAL([HAVE_GETPAGESIZE], [test "x$ac_cv_func_getpagesize" = xyes])
AM_CONDITIONAL([HAVE_GETOPT], [test "x$ac_cv_func_getopt" = xyes])
AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes])