diff --git a/configure.ac b/configure.ac index 7b28666..8187fd7 100644 --- a/configure.ac +++ b/configure.ac @@ -370,6 +370,9 @@ AC_SUBST(PSL_TESTFILE) AC_FUNC_ALLOCA AC_CHECK_FUNCS([strndup clock_gettime fmemopen nl_langinfo]) +# check for dirent.h +AC_HEADER_DIRENT + # Override the template file name of the generated .pc file, so that there # is no need to rename the template file when the API version changes. AC_CONFIG_FILES([Makefile diff --git a/fuzz/main.c b/fuzz/main.c index cc8e891..eb7a10f 100644 --- a/fuzz/main.c +++ b/fuzz/main.c @@ -40,7 +40,6 @@ #include #include #include -#include #if defined (_MSC_VER) && ! defined (ssize_t) #include @@ -49,7 +48,9 @@ typedef SSIZE_T ssize_t; #include "fuzzer.h" -#if defined (TEST_RUN) && defined (HAVE_FMEMOPEN) +#if defined (TEST_RUN) && defined (HAVE_FMEMOPEN) && defined (HAVE_DIRENT_H) + +#include static void test_all_from(const char *dirname) { @@ -122,7 +123,7 @@ int main(int argc, char **argv) return 0; } -#else /* TEST_RUN && HAVE_FMEMOPEN */ +#else /* TEST_RUN && HAVE_FMEMOPEN && HAVE_DIRENT_H */ #ifndef __AFL_LOOP static int __AFL_LOOP(int n) @@ -158,4 +159,4 @@ int main(int argc, char **argv) #endif } -#endif /* TEST_RUN && HAVE_FMEMOPEN*/ +#endif /* TEST_RUN && HAVE_FMEMOPEN && HAVE_DIRENT_H */ diff --git a/meson.build b/meson.build index 36a55bb..ab3ce38 100644 --- a/meson.build +++ b/meson.build @@ -107,6 +107,7 @@ config.set('BUILTIN_GENERATOR_LIBIDN', enable_builtin == 'libidn') config.set('HAVE_UNISTD_H', cc.check_header('unistd.h')) config.set('HAVE_STDINT_H', cc.check_header('stdint.h')) config.set('HAVE_ALLOCA_H', cc.check_header('alloca.h')) +config.set('HAVE_DIRENT_H', cc.check_header('dirent.h')) config.set('HAVE_ALLOCA', cc.has_function('alloca')) config.set('HAVE_STRNDUP', cc.has_function('strndup')) config.set('HAVE_CLOCK_GETTIME', cc.has_function('clock_gettime'))