From b9a190264f9a161d99b1d9476e2bc16d93432bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Tue, 10 Mar 2020 15:16:25 +0100 Subject: [PATCH] psl.c: Include strings.h only if it is available --- configure.ac | 3 +++ src/psl.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0b9e892..f4464cd 100644 --- a/configure.ac +++ b/configure.ac @@ -373,6 +373,9 @@ AC_CHECK_FUNCS([strndup clock_gettime fmemopen nl_langinfo]) # check for dirent.h AC_HEADER_DIRENT +# strings.h may not exist on WIN32 +AC_CHECK_HEADERS([strings.h]) + # 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/src/psl.c b/src/psl.c index 7b6d7f0..f1691e0 100644 --- a/src/psl.c +++ b/src/psl.c @@ -64,7 +64,9 @@ typedef SSIZE_T ssize_t; #include #include #include -#include +#ifdef HAVE_STRINGS_H +# include +#endif #include #include #include