diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index bdacc8b540b..2ba67df8bc9 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -85,6 +85,12 @@ 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
+#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
with the #define:s in place, the prototypes will be wrong and we get