From 6e2ee2a127952aaee63921a99a065693d3e8e07b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 23 Aug 2020 19:25:58 +0300 Subject: [PATCH] Fix image display on w32 as followup to recent changes The new code calls 'malloc' and 'free', so we can no longer * src/image.c (struct image_type): Rename 'load' to 'load_img' and 'free' to 'free_img'. All callers changed. (free_image) [WINDOWSNT]: Don't #undef 'free'. --- src/image.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/image.c b/src/image.c index 4933b619f66..35c5946c72f 100644 --- a/src/image.c +++ b/src/image.c @@ -758,10 +758,10 @@ struct image_type /* Load IMG which is used on frame F from information contained in IMG->spec. Value is true if successful. */ - bool (*load) (struct frame *f, struct image *img); + bool (*load_img) (struct frame *f, struct image *img); /* Free resources of image IMG which is used on frame F. */ - void (*free) (struct frame *f, struct image *img); + void (*free_img) (struct frame *f, struct image *img); #ifdef WINDOWSNT /* Initialization function (used for dynamic loading of image @@ -1197,13 +1197,8 @@ free_image (struct frame *f, struct image *img) XRenderFreePicture (FRAME_X_DISPLAY (f), img->mask_picture); #endif - /* Windows NT redefines 'free', but in this file, we need to - avoid the redefinition. */ -#ifdef WINDOWSNT -#undef free -#endif /* Free resources, then free IMG. */ - img->type->free (f, img); + img->type->free_img (f, img); xfree (img); } } @@ -1249,7 +1244,7 @@ prepare_image_for_display (struct frame *f, struct image *img) /* If IMG doesn't have a pixmap yet, load it now, using the image type dependent loader function. */ if (img->pixmap == NO_PIXMAP && !img->load_failed_p) - img->load_failed_p = ! img->type->load (f, img); + img->load_failed_p = ! img->type->load_img (f, img); #ifdef USE_CAIRO if (!img->load_failed_p) @@ -1266,7 +1261,7 @@ prepare_image_for_display (struct frame *f, struct image *img) if (img->cr_data == NULL) { img->load_failed_p = 1; - img->type->free (f, img); + img->type->free_img (f, img); } } unblock_input (); @@ -2361,7 +2356,7 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) cache_image (f, img); img->face_foreground = foreground; img->face_background = background; - img->load_failed_p = ! img->type->load (f, img); + img->load_failed_p = ! img->type->load_img (f, img); /* If we can't load the image, and we don't have a width and height, use some arbitrary width and height so that we can -- 2.39.2