summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-10-06 18:11:43 +0300
committerEli Zaretskii <eliz@gnu.org>2016-10-06 18:11:43 +0300
commitd48369db9c97b6f2accf702e5bbe0bda11cb92a1 (patch)
tree73975d4d08fc4da05e2bbd2059467eb85909e0db /nt
parent6e6c08815347a78008211613c9ddfa0acd7f0ef8 (diff)
downloademacs-d48369db9c97b6f2accf702e5bbe0bda11cb92a1.tar.gz
Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2
* nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before defining to avoid redefinition warnings. * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid inclusion of sys/stat.h from the system headers, which could then lead to compilation errors due to redefinition of 'struct stat' etc. This is needed because latest versions of MinGW runtime include sys/stat.h from wchar.h. * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily redefine to 4 to avoid conflict between 2 definitions of MemoryBarrier. (Bug#24613)
Diffstat (limited to 'nt')
-rw-r--r--nt/inc/ms-w32.h1
-rw-r--r--nt/inc/sys/stat.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 8e3a8c2c226..24076a31eeb 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -146,6 +146,7 @@ extern char *getenv ();
in its system headers, and is not really compatible with values
lower than 0x0500, so leave it alone. */
#ifndef MINGW_W64
+# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0400
#endif
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index 45bc2ea1e0c..ea14f075471 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -30,6 +30,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# define __MINGW_NOTHROW
#endif
+/* Prevent the MinGW stat.h header from being included, ever. */
+#ifndef _SYS_STAT_H
+# define _SYS_STAT_H
+#endif
+#ifndef _INC_STAT_H
+# define _INC_STAT_H
+#endif
+
#include <sys/types.h>
#include <time.h>