aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorEli Zaretskii2016-10-06 18:08:31 +0300
committerEli Zaretskii2016-10-06 18:08:31 +0300
commit34b6df19a4dafe0227ab663c971079e68e17f393 (patch)
tree0de552eb621d62e870215cab1b0c2db9530b649f /src/image.c
parent4ef9ea2b2ad0db53d674ce6c691b605d894ae558 (diff)
downloademacs-34b6df19a4dafe0227ab663c971079e68e17f393.tar.gz
emacs-34b6df19a4dafe0227ab663c971079e68e17f393.zip
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) Do not merge to master!
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c
index a85d5149e7e..78539d91d2b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8994,10 +8994,27 @@ svg_image_p (Lisp_Object object)
8994 return fmt[SVG_FILE].count + fmt[SVG_DATA].count == 1; 8994 return fmt[SVG_FILE].count + fmt[SVG_DATA].count == 1;
8995} 8995}
8996 8996
8997/* Some versions of glib's gatomic.h define MemoryBarrier, but MinGW
8998 w32api 3.18 and later has its own definition. The following gross
8999 hack avoids the clash. */
9000# ifdef WINDOWSNT
9001# if (__W32API_MAJOR_VERSION + (__W32API_MINOR_VERSION >= 18)) >= 4
9002# define W32_SAVE_MINGW_VERSION __MINGW_MAJOR_VERSION
9003# undef __MINGW_MAJOR_VERSION
9004# define __MINGW_MAJOR_VERSION 4
9005# endif
9006# endif
9007
8997# include <librsvg/rsvg.h> 9008# include <librsvg/rsvg.h>
8998 9009
8999# ifdef WINDOWSNT 9010# ifdef WINDOWSNT
9000 9011
9012# ifdef W32_SAVE_MINGW_VERSION
9013# undef __MINGW_MAJOR_VERSION
9014# define __MINGW_MAJOR_VERSION W32_SAVE_MINGW_VERSION
9015# undef W32_SAVE_MINGW_VERSION
9016# endif
9017
9001/* SVG library functions. */ 9018/* SVG library functions. */
9002DEF_DLL_FN (RsvgHandle *, rsvg_handle_new, (void)); 9019DEF_DLL_FN (RsvgHandle *, rsvg_handle_new, (void));
9003DEF_DLL_FN (void, rsvg_handle_get_dimensions, 9020DEF_DLL_FN (void, rsvg_handle_get_dimensions,