]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor compilation problems on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 6 Aug 2019 14:53:03 +0000 (17:53 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 6 Aug 2019 14:53:03 +0000 (17:53 +0300)
* 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
src/w32fns.c

index 8cab860085fe1df13bce372510676f70ef3b506a..81d8cb4e2b2f5959eb8ae4506172e082bbd81798 100644 (file)
@@ -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)
index a2a88b25881f8979955d624e05893a0bb7538805..fc80e018834d2301756a671c017e6cc53c99de43 100644 (file)
@@ -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;