]> git.eshelyaron.com Git - emacs.git/commitdiff
Make 'yank-media' on MS-Windows require native image APIs
authorEli Zaretskii <eliz@gnu.org>
Tue, 5 Nov 2024 12:29:02 +0000 (14:29 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 8 Nov 2024 13:31:34 +0000 (14:31 +0100)
* src/w32select.c (convert_dibv5_to_png) [!HAVE_NATIVE_IMAGE_API]:
Fail if GDI+ cannot be used.  Patch by Cecilio Pardo
<cpardo@imayhem.com>.  (Bug#71909)

* etc/NEWS: Mention this dependency.

(cherry picked from commit 8a7910fb67e3b89de430d3b3e5009b145ec0c602)

etc/NEWS
src/w32select.c

index af23b71d0cc69dc19f2c65de5ea52b896bfd6659..453f2545718dae2255f8d69d977e6c3ba356d245 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -751,7 +751,9 @@ color Emoji font installed on your system for the 'emoji' script.
 +++
 ** Emacs on MS-Windows now supports 'yank-media'.
 This command inserts clipboard data of different formats into the
-current buffer, if the major mode supports it.
+current buffer, if the major mode supports it.  (Support for
+'yank-media' will be unavailable on MS-Windows if Emacs was configured
+'--without-native-image-api'.)
 
 
 \f
index 7e8dc3f0702a1b3bf420a93ea72fba9e4928df78..646c8faf634210f4799ad11c517bc090dd388b79 100644 (file)
@@ -825,6 +825,7 @@ static const char *stdfmt_name[] = {
 static bool
 convert_dibv5_to_png (char *data, int size, char *temp_file)
 {
+#ifdef HAVE_NATIVE_IMAGE_API
   CLSID clsid_png;
 
   if (!w32_gdiplus_startup ()
@@ -858,6 +859,9 @@ convert_dibv5_to_png (char *data, int size, char *temp_file)
   if (status != Ok)
     return false;
   return true;
+#else  /* !HAVE_NATIVE_IMAGE_API */
+  return false;
+#endif
 }
 
 static int