From: Eli Zaretskii Date: Sun, 4 Apr 2021 11:53:20 +0000 (+0300) Subject: Fix MS-Windows build X-Git-Tag: emacs-28.0.90~3021 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c3cd3fb0513d543f763e47093ec9a283eb6e97d0;p=emacs.git Fix MS-Windows build * src/image.c: (init_svg_functions) [WINDOWSNT]: Define and load rsvg_handle_set_stylesheet from the DLL for librsvg > 2.48. (lookup_image): Use xmalloc. --- diff --git a/src/image.c b/src/image.c index 08e937e501f..6fe0b23f730 100644 --- a/src/image.c +++ b/src/image.c @@ -2442,7 +2442,7 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) img->face_foreground = foreground; img->face_background = background; img->face_font_size = font_size; - img->face_font_family = malloc (strlen (font_family) + 1); + img->face_font_family = xmalloc (strlen (font_family) + 1); strcpy (img->face_font_family, font_family); img->load_failed_p = ! img->type->load_img (f, img); @@ -9647,6 +9647,11 @@ DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); # endif + +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet, + (RsvgHandle *, const guint8 *, gsize, GError **)); +# endif DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); @@ -9699,6 +9704,9 @@ init_svg_functions (void) #if LIBRSVG_CHECK_VERSION (2, 46, 0) LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); +#endif +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + LOAD_DLL_FN (library, rsvg_handle_set_stylesheet); #endif LOAD_DLL_FN (library, rsvg_handle_get_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); @@ -9740,6 +9748,9 @@ init_svg_functions (void) # undef rsvg_handle_get_geometry_for_layer # endif # undef rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +# undef rsvg_handle_set_stylesheet +# endif # undef rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # undef g_file_new_for_path @@ -9773,6 +9784,9 @@ init_svg_functions (void) fn_rsvg_handle_get_geometry_for_layer # endif # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +# define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet +# endif # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # define g_file_new_for_path fn_g_file_new_for_path