summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-08-06 17:53:03 +0300
committerEli Zaretskii <eliz@gnu.org>2019-08-06 17:53:03 +0300
commit96e672364cbd6f1a865511d78f3a218c0570345e (patch)
tree0678bcdc4923bcca364df5b284065114e3642c83
parent4ce9c6d0b58bd77bc811d6c1c5caf955a5a0be2f (diff)
downloademacs-96e672364cbd6f1a865511d78f3a218c0570345e.tar.gz
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.
-rw-r--r--src/image.c12
-rw-r--r--src/w32fns.c2
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;