From 96e672364cbd6f1a865511d78f3a218c0570345e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 6 Aug 2019 17:53:03 +0300 Subject: [PATCH] Fix minor compilation problems on MS-Windows * src/w32fns.c (Fdefault_printer_name): Fix size of local buffer. * src/image.c [WINDOWSNT]: Test __MINGW_MAJOR_VERSION as well to shut up compiler warnings. --- src/image.c | 12 ++++++------ src/w32fns.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/image.c b/src/image.c index 8cab860085f..81d8cb4e2b2 100644 --- a/src/image.c +++ b/src/image.c @@ -9290,13 +9290,13 @@ svg_image_p (Lisp_Object object) # 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 +# if defined W32_SAVE_MINGW_VERSION && defined __MINGW_MAJOR_VERSION +# undef __MINGW_MAJOR_VERSION +# define __MINGW_MAJOR_VERSION W32_SAVE_MINGW_VERSION +# ifdef __MINGW_MAJOR_VERSION +# undef W32_SAVE_MINGW_VERSION +# endif # endif -# endif /* SVG library functions. */ # if LIBRSVG_CHECK_VERSION (2, 32, 0) diff --git a/src/w32fns.c b/src/w32fns.c index a2a88b25881..fc80e018834 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -9230,7 +9230,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name, 0, 0, 0, doc: /* Return the name of Windows default printer device. */) (void) { - static char pname_buf[256]; + static char pname_buf[2 * MAX_UTF8_PATH + 3 - 1]; int err; HANDLE hPrn; PRINTER_INFO_2W *ppi2w = NULL; -- 2.39.2