diff options
| author | Eli Zaretskii | 2016-10-06 18:11:43 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-10-06 18:11:43 +0300 |
| commit | d48369db9c97b6f2accf702e5bbe0bda11cb92a1 (patch) | |
| tree | 73975d4d08fc4da05e2bbd2059467eb85909e0db /src/image.c | |
| parent | 6e6c08815347a78008211613c9ddfa0acd7f0ef8 (diff) | |
| download | emacs-d48369db9c97b6f2accf702e5bbe0bda11cb92a1.tar.gz emacs-d48369db9c97b6f2accf702e5bbe0bda11cb92a1.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)
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index c3c526d2525..9bd245585c6 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9013,10 +9013,30 @@ svg_image_p (Lisp_Object object) | |||
| 9013 | return fmt[SVG_FILE].count + fmt[SVG_DATA].count == 1; | 9013 | return fmt[SVG_FILE].count + fmt[SVG_DATA].count == 1; |
| 9014 | } | 9014 | } |
| 9015 | 9015 | ||
| 9016 | /* Some versions of glib's gatomic.h define MemoryBarrier, but MinGW | ||
| 9017 | w32api 3.18 and later has its own definition. The following gross | ||
| 9018 | hack avoids the clash. */ | ||
| 9019 | # ifdef WINDOWSNT | ||
| 9020 | # if (__W32API_MAJOR_VERSION + (__W32API_MINOR_VERSION >= 18)) >= 4 | ||
| 9021 | # define W32_SAVE_MINGW_VERSION __MINGW_MAJOR_VERSION | ||
| 9022 | # undef __MINGW_MAJOR_VERSION | ||
| 9023 | # define __MINGW_MAJOR_VERSION 4 | ||
| 9024 | # endif | ||
| 9025 | # endif | ||
| 9026 | |||
| 9016 | # include <librsvg/rsvg.h> | 9027 | # include <librsvg/rsvg.h> |
| 9017 | 9028 | ||
| 9018 | # ifdef WINDOWSNT | 9029 | # ifdef WINDOWSNT |
| 9019 | 9030 | ||
| 9031 | /* Restore the original definition of __MINGW_MAJOR_VERSION. */ | ||
| 9032 | # ifdef W32_SAVE_MINGW_VERSION | ||
| 9033 | # undef __MINGW_MAJOR_VERSION | ||
| 9034 | # define __MINGW_MAJOR_VERSION W32_SAVE_MINGW_VERSION | ||
| 9035 | # ifdef __MINGW_MAJOR_VERSION | ||
| 9036 | # undef W32_SAVE_MINGW_VERSION | ||
| 9037 | # endif | ||
| 9038 | # endif | ||
| 9039 | |||
| 9020 | /* SVG library functions. */ | 9040 | /* SVG library functions. */ |
| 9021 | DEF_DLL_FN (RsvgHandle *, rsvg_handle_new, (void)); | 9041 | DEF_DLL_FN (RsvgHandle *, rsvg_handle_new, (void)); |
| 9022 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, | 9042 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, |