]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stdio-windows: Fix compilation error on old mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Jan 2026 22:56:58 +0000 (23:56 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Jan 2026 22:56:58 +0000 (23:56 +0100)
Reported by Eli Zaretskii in
<https://lists.gnu.org/archive/html/bug-texinfo/2026-01/msg00099.html>.

* lib/stdio-consolesafe.c (local_vasprintf): Renamed from vasprintf.
(vasprintf): Define as a macro, not as a function.

ChangeLog
lib/stdio-consolesafe.c

index d7f00a1f5e6e36f6d5b71d3a9d048c93158eef2b..1f258a8674f78b19b8663ec5793c1201392d376a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-01-24  Bruno Haible  <bruno@clisp.org>
+
+       stdio-windows: Fix compilation error on old mingw.
+       Reported by Eli Zaretskii in
+       <https://lists.gnu.org/archive/html/bug-texinfo/2026-01/msg00099.html>.
+       * lib/stdio-consolesafe.c (local_vasprintf): Renamed from vasprintf.
+       (vasprintf): Define as a macro, not as a function.
+
 2026-01-24  Bruno Haible  <bruno@clisp.org>
 
        selinux-h: Fix compilation errors on Android outside Termux.
index c9486f1a32f207732e69ac122f1a156b355b4af6..f634de13ef4c0830e0baa707c72a66f69a9736d2 100644 (file)
@@ -85,7 +85,7 @@ gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp)
    specifiers as the mingw *printf functions.  */
 
 static int
-vasprintf (char **resultp, const char *format, va_list args)
+local_vasprintf (char **resultp, const char *format, va_list args)
 {
   /* First try: Use a stack-allocated buffer.  */
   char buf[2048];
@@ -123,6 +123,9 @@ vasprintf (char **resultp, const char *format, va_list args)
   return nbytes;
 }
 
+#  undef vasprintf
+#  define vasprintf local_vasprintf
+
 # endif
 
 /* Bypass the functions __mingw_[v][f]printf, that trigger a bug in msvcrt,