Eli Zaretskii wrote:

I needed this commit to prevent temacs from crashing during dumping.
Don't ask me how including errno.h (both the one from Gnulib and the
MinGW one) could cause this, especially as the preprocessed __fpending
doesn't seem to change a bit as result of that, and it doesn't seem to
even be called during dumping.  The facts are stubborn: if I leave
that inclusion in place, I get a crash, removing it fixes the crash.

I propagated this fix back to gnulib by installing the attached patch to Gnulib. I'll CC: this to Bruno Haible, who made the recent change to fpending. I don't use MinGW myself.
>From 60635cc80e74f7f48cf5f794cc1d3d43d4c4f1e9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Fri, 16 Dec 2016 07:38:58 -0800
Subject: [PATCH] fpending: fix port to MinGW on Emacs

* lib/stdio-impl.h [__MINGW32__]: Do not include errno.h.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
Is Plan 9 still a valid porting target, anyway?
---
 ChangeLog        | 8 ++++++++
 lib/stdio-impl.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5e9e801..dd67dba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-12-16  Paul Eggert  <egg...@cs.ucla.edu>
+
+	fpending: fix port to MinGW on Emacs
+	* lib/stdio-impl.h [__MINGW32__]: Do not include errno.h.
+	Problem reported by Eli Zaretskii in:
+	http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
+	Is Plan 9 still a valid porting target, anyway?
+
 2016-12-15  Paul Eggert  <egg...@cs.ucla.edu>
 
 	safe-alloc: use xalloc-oversized
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 766d693..1972a33 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -26,7 +26,9 @@
 # include <sys/param.h>
 #endif
 
+#ifndef __MINGW32__
 #include <errno.h>                             /* For detecting Plan9.  */
+#endif
 
 #if defined __sferror || defined __DragonFly__ || defined __ANDROID__
   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-- 
2.7.4

Reply via email to