From 6bda6e21234dd07504362755c8c22e5f15ee92f7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 14 Apr 2026 15:32:11 +0300 Subject: [PATCH] ; Another attempt to fix the MinGW64 build * src/conf_post.h [WINDOWSNT]: Add prototype for 'getline'. --- src/conf_post.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/conf_post.h b/src/conf_post.h index 78b542d69d3..e2addf37103 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -426,10 +426,17 @@ extern int gl_consolesafe_vprintf (const char *restrict format, va_list args) # endif /* !_UCRT */ #endif /* WINDOWSNT */ -#if defined WINDOWSNT && !defined HAVE_DECL_GETDELIM +#if defined WINDOWSNT /* MinGW64 doesn't have getdelim, called by Gnulib's getline, but the MS-Windows build omits stdio.h module, where getdelim is declared. */ -# include -# include +# if !(defined HAVE_DECL_GETDELIM && defined HAVE_DECL_GETLINE) +# include +# include +# if !defined HAVE_DECL_GETDELIM extern ssize_t getdelim (char **, size_t *, int, FILE *); +# endif +# if !defined HAVE_DECL_GETLINE +extern ssize_t getline (char **, size_t *, FILE *); +# endif +# endif #endif