On 2026-10-10 00:44, Eli Zaretskii wrote:
Paul, any suggestions given the above?

I installed the attached patch into Gnulib and propagated this into Emacs 
master. This should fix Emacs's issue with _UCRT.

This patch adds two Gnulib modules localtime and tzsanitize to Emacs, and 
emacs/admin/merge-gnulib said I should fix nt/gnulib-cfg.mk or notify 
emacs-devel. I'm doing the latter in this email's cc. Though I'm no NT expert I 
guess no change to nt/gnulib-cfg.mk is needed.
From a00dbd1ca03ff84bc99126d3e01c3e8514e90989 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sat, 10 Oct 2026 12:54:48 -0700
Subject: [PATCH] stdio-windows: fix _UCRT test on MinGW-64

Problem reported for Emacs by Yue Yi <https://bugs.gnu.org/81837#53>.
* modules/stdio-windows (USES_MSVCRT): Include <stdio.h>
before testing whether _UCRT is defined.
---
 ChangeLog             | 7 +++++++
 modules/stdio-windows | 1 +
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e9a3d9a9cc..ed8904a9de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-10-10  Paul Eggert  <[email protected]>
+
+	stdio-windows: fix _UCRT test on MinGW-64
+	Problem reported for Emacs by Yue Yi <https://bugs.gnu.org/81837#53>.
+	* modules/stdio-windows (USES_MSVCRT): Include <stdio.h>
+	before testing whether _UCRT is defined.
+
 2026-10-07  Bruno Haible  <[email protected]>
 
 	all: Update URLs to msdn.microsoft.com or docs.microsoft.com.
diff --git a/modules/stdio-windows b/modules/stdio-windows
index 9a18fe58d1..f0871a7997 100644
--- a/modules/stdio-windows
+++ b/modules/stdio-windows
@@ -15,6 +15,7 @@ USES_MSVCRT=0
 case "$host_os" in
   mingw* | windows*)
     AC_EGREP_CPP([Special], [
+#include <stdio.h>
 #ifndef _UCRT
  Special
 #endif
-- 
2.53.0

Reply via email to