From dd8f4c311944c7fc32774b8f6e0c7d819406a792 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 5 Nov 2024 14:29:02 +0200 Subject: [PATCH] Make 'yank-media' on MS-Windows require native image APIs * src/w32select.c (convert_dibv5_to_png) [!HAVE_NATIVE_IMAGE_API]: Fail if GDI+ cannot be used. Patch by Cecilio Pardo . (Bug#71909) * etc/NEWS: Mention this dependency. (cherry picked from commit 8a7910fb67e3b89de430d3b3e5009b145ec0c602) --- etc/NEWS | 4 +++- src/w32select.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index af23b71d0cc..453f2545718 100644 --- 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'.) diff --git a/src/w32select.c b/src/w32select.c index 7e8dc3f0702..646c8faf634 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -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 -- 2.39.5