commit 51558effdc453d359b4a174bf72db787dc0114d1 (HEAD, refs/remotes/origin/master) Author: Noah Friedman Date: Thu Oct 6 18:32:59 2016 -0700 Update comment. diff --git a/etc/emacs-buffer.gdb b/etc/emacs-buffer.gdb index 26c13c1..7102dc6 100644 --- a/etc/emacs-buffer.gdb +++ b/etc/emacs-buffer.gdb @@ -2,7 +2,7 @@ # Copyright (C) 2005-2016 Free Software Foundation, Inc. -# Maintainer: Noah Friedman +# Author: Noah Friedman # Created: 2005-04-28 # This file is part of GNU Emacs. commit d48369db9c97b6f2accf702e5bbe0bda11cb92a1 Author: Eli Zaretskii Date: Thu Oct 6 18:11:43 2016 +0300 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) diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 8e3a8c2..24076a3 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 45bc2ea..ea14f07 100644 --- a/nt/inc/sys/stat.h +++ b/nt/inc/sys/stat.h @@ -30,6 +30,14 @@ along with GNU Emacs. If not, see . */ # 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 #include diff --git a/src/image.c b/src/image.c index c3c526d..9bd2455 100644 --- a/src/image.c +++ b/src/image.c @@ -9013,10 +9013,30 @@ svg_image_p (Lisp_Object object) return fmt[SVG_FILE].count + fmt[SVG_DATA].count == 1; } +/* Some versions of glib's gatomic.h define MemoryBarrier, but MinGW + w32api 3.18 and later has its own definition. The following gross + hack avoids the clash. */ +# ifdef WINDOWSNT +# if (__W32API_MAJOR_VERSION + (__W32API_MINOR_VERSION >= 18)) >= 4 +# define W32_SAVE_MINGW_VERSION __MINGW_MAJOR_VERSION +# undef __MINGW_MAJOR_VERSION +# define __MINGW_MAJOR_VERSION 4 +# endif +# endif + # include # ifdef WINDOWSNT +/* Restore the original definition of __MINGW_MAJOR_VERSION. */ +# ifdef W32_SAVE_MINGW_VERSION +# undef __MINGW_MAJOR_VERSION +# define __MINGW_MAJOR_VERSION W32_SAVE_MINGW_VERSION +# ifdef __MINGW_MAJOR_VERSION +# undef W32_SAVE_MINGW_VERSION +# endif +# endif + /* SVG library functions. */ DEF_DLL_FN (RsvgHandle *, rsvg_handle_new, (void)); DEF_DLL_FN (void, rsvg_handle_get_dimensions,