From 8fdc22328b0932f2360f722e36a7f1ac7e5e5a20 Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Sat, 17 Sep 2016 11:05:07 -0700
Subject: [PATCH] Define _GNU_SOURCE in files delaying config.h
Problem reported by Richard Copley in:
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00440.html
* src/w32.c, src/w32notify.c, src/w32proc.c (_GNU_SOURCE):
Define early.
---
src/unexmacosx.c | 5 +----
src/w32.c | 3 +++
src/w32notify.c | 3 +++
src/w32proc.c | 3 +++
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 2ba67df..185a9d1 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -85,11 +85,8 @@ along with GNU Emacs. If not, see . */
be changed accordingly.
*/
-/* Make symbols like LLONG_WIDTH visible when the Gnulib
- is included before . */
-#ifndef _GNU_SOURCE
+/* Enable GNU extensions in gnulib replacement headers. */
#define _GNU_SOURCE 1
-#endif
/* config.h #define:s malloc/realloc/free and then includes stdlib.h.
We want the undefined versions, but if config.h includes stdlib.h
diff --git a/src/w32.c b/src/w32.c
index 1db3426..6cb8e74 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -21,6 +21,9 @@ along with GNU Emacs. If not, see . */
Geoff Voelker (address@hidden) 7-29-94
*/
+/* Enable GNU extensions in gnulib replacement headers. */
+#define _GNU_SOURCE 1
+
#include
#include /* for offsetof */
#include
diff --git a/src/w32notify.c b/src/w32notify.c
index d4a113a..15e8a86 100644
--- a/src/w32notify.c
+++ b/src/w32notify.c
@@ -81,6 +81,9 @@ along with GNU Emacs. If not, see . */
thread to exit. The main thread waits for some time for the worker
thread to exit, and if it doesn't, terminates it forcibly. */
+/* Enable GNU extensions in gnulib replacement headers. */
+#define _GNU_SOURCE 1
+
#include
#include
diff --git a/src/w32proc.c b/src/w32proc.c
index 90cef32..e23b1b3 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -22,6 +22,9 @@ along with GNU Emacs. If not, see . */
Adapted from alarm.c by Tim Fleehart
*/
+/* Enable GNU extensions in gnulib replacement headers. */
+#define _GNU_SOURCE 1
+
#include
#include
#include
--
2.7.4