diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-10-22 15:41:00 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-10-22 15:41:00 +0300 |
commit | 2bffa0189dec332f0026c144f081493e2b7fe94b (patch) | |
tree | 6d291ac6c41c794f7a9a4157b32af735e3ca29d4 /src/image.c | |
parent | bc2a5c112796ea9f072984b471f980e4321263b3 (diff) | |
download | emacs-2bffa0189dec332f0026c144f081493e2b7fe94b.tar.gz |
Fix WebP support on MS-Windows
* src/image.c (WebPDecodeRGBA, WebPDecodeRGB, WebPFree): Use
correct names and argument lists in DEF_DLL_FN; fix typos.
(WebPGetFeaturesInternal): Load this instead of WebPGetFeatures,
which is a static inline function in webp/decode.h.
(WebPGetFeatures): Redirect to call WebPGetFeaturesInternal.
* lisp/term/w32-win.el (dynamic-library-alist): Fix the name of
the WebP symbol.
* configure.ac (HAVE_WEBP): Fix detection of libwebp on MinGW.
* nt/INSTALL.W64:
* nt/INSTALL: Update information about libwebp availability.
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c index fe0bb509c58..308dc687260 100644 --- a/src/image.c +++ b/src/image.c @@ -8802,10 +8802,15 @@ webp_image_p (Lisp_Object object) /* WebP library details. */ DEF_DLL_FN (int, WebPGetInfo, (const uint8_t *, size_t, int *, int *)); -DEF_DLL_FN (VP8StatusCode, WebPGetFeatures, (const uint8_t *, size_t, WebPBitstreamFeatures *)); +/* WebPGetFeatures is a static inline function defined in WebP's + decode.h. Since we cannot use that with dynamically-loaded libwebp + DLL, we instead load the internal function it calls and redirect to + that through a macro. */ +DEF_DLL_FN (VP8StatusCode, WebPGetFeaturesInternal, + (const uint8_t *, size_t, WebPBitstreamFeatures *, int)); +DEF_DLL_FN (uint8_t *, WebPDecodeRGBA, (const uint8_t *, size_t, int *, int *)); DEF_DLL_FN (uint8_t *, WebPDecodeRGB, (const uint8_t *, size_t, int *, int *)); -DEF_DLL_FN (uint8_t *, WebPDecodeBGR, (const uint8_t *, size_t, int *, int *)); -DEF_DLL_FN (void, WebPFreeDecBuffer (WebPDecBuffer *)); +DEF_DLL_FN (void, WebPFree, (void *)); static bool init_webp_functions (void) @@ -8816,7 +8821,7 @@ init_webp_functions (void) return false; LOAD_DLL_FN (library, WebPGetInfo); - LOAD_DLL_FN (library, WebPGetFeatures); + LOAD_DLL_FN (library, WebPGetFeaturesInternal); LOAD_DLL_FN (library, WebPDecodeRGBA); LOAD_DLL_FN (library, WebPDecodeRGB); LOAD_DLL_FN (library, WebPFree); @@ -8830,7 +8835,8 @@ init_webp_functions (void) #undef WebPFree #define WebPGetInfo fn_WebPGetInfo -#define WebPGetFeatures fn_WebPGetFeatures +#define WebPGetFeatures(d,s,f) \ + fn_WebPGetFeaturesInternal(d,s,f,WEBP_DECODER_ABI_VERSION) #define WebPDecodeRGBA fn_WebPDecodeRGBA #define WebPDecodeRGB fn_WebPDecodeRGB #define WebPFree fn_WebPFree |