+2018-01-31 Bruno Haible <bruno@clisp.org>
+
+ environ: Fix link error on 64-bit Cygwin.
+ * lib/unistd.in.h (environ): On Cygwin, redeclare with the
+ __declspec(dllimport) attribute.
+ * doc/posix-functions/environ.texi: Mention the Cygwin problem.
+
2018-01-30 Bruno Haible <bruno@clisp.org>
get-rusage-data: Add support for Minix 3.
#define environ (*_NSGetEnviron())
@end smallexample
This works at all versions of Mac OS X.
+@item
+On Cygwin in 64-bit mode, references to this variable cause a link error when
+the option @code{-Wl,--disable-auto-import} is in use.
@end itemize
Portability problems not fixed by Gnulib:
#if @GNULIB_ENVIRON@
+# if defined __CYGWIN__
+/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
+ the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
+ This leads to a link error on 64-bit Cygwin when the option
+ -Wl,--disable-auto-import is in use. */
+_GL_EXTERN_C __declspec(dllimport) char **environ;
+# endif
# if !@HAVE_DECL_ENVIRON@
/* Set of environment variables and values. An array of strings of the form
"VARIABLE=VALUE", terminated with a NULL. */