On 10/23/21 4:42 PM, Andy Moreton wrote:
Can this issue be addressed in gnulib so the emacs bug can be fixed ?

This appears to be an issue in Emacs not Gnulib, as a few of Emacs's MS-Windows-specific files don't include <config.h> first, which is a documented requirement for Gnulib-using apps. Proposed Emacs patch attached. I haven't tested or installed this, as I don't use MingW.

>From 7bb574b48c7c8be0eb1e941c6da048cfb509cdff Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 23 Oct 2021 20:35:18 -0700
Subject: [PATCH] Include <config.h> first in MS-Windows source

---
 lib-src/ntlib.c | 2 ++
 nt/addpm.c      | 3 +++
 nt/cmdproxy.c   | 2 ++
 nt/ddeclient.c  | 2 ++
 nt/preprep.c    | 2 ++
 nt/runemacs.c   | 2 ++
 6 files changed, 13 insertions(+)

diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index bcbc006431..e011de5b91 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -20,6 +20,8 @@ Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #include <windows.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/nt/addpm.c b/nt/addpm.c
index f54a6ea9f7..4ec372ccfe 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -34,6 +34,9 @@
    installed, then the DDE fallback for creating icons the Windows 3.1
    progman way will be used instead, but that is prone to lockups
    caused by other applications not servicing their message queues.  */
+
+#include <config.h>
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <malloc.h>
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 224f68b1e8..505855318d 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -27,6 +27,8 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #include <windows.h>
 
 #include <stdarg.h>  /* va_args */
diff --git a/nt/ddeclient.c b/nt/ddeclient.c
index c577bfcfa9..1390c334b7 100644
--- a/nt/ddeclient.c
+++ b/nt/ddeclient.c
@@ -16,6 +16,8 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #include <windows.h>
 #include <ddeml.h>
 #include <stdlib.h>
diff --git a/nt/preprep.c b/nt/preprep.c
index 78ed1c3238..b73d3bb9fa 100644
--- a/nt/preprep.c
+++ b/nt/preprep.c
@@ -21,6 +21,8 @@
      based on code from addsection.c
 */
 
+#include <config.h>
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
diff --git a/nt/runemacs.c b/nt/runemacs.c
index 308e856be2..f8f60b0665 100644
--- a/nt/runemacs.c
+++ b/nt/runemacs.c
@@ -40,6 +40,8 @@ Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
 /* #define CHOOSE_NEWEST_EXE */
 
+#include <config.h>
+
 #include <windows.h>
 #include <string.h>
 #include <malloc.h>
-- 
2.31.1

Reply via email to