diff options
| author | Eli Zaretskii | 2021-04-04 14:53:20 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-04-04 14:54:19 +0300 |
| commit | c3cd3fb0513d543f763e47093ec9a283eb6e97d0 (patch) | |
| tree | 36bd407f7543a4673bbcaddc83432dc427e3eea3 | |
| parent | 523fb9b5503a7ecdb8e79e2e0269b901f6a6f233 (diff) | |
| download | emacs-c3cd3fb0513d543f763e47093ec9a283eb6e97d0.tar.gz emacs-c3cd3fb0513d543f763e47093ec9a283eb6e97d0.zip | |
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.
| -rw-r--r-- | src/image.c | 16 |
1 files changed, 15 insertions, 1 deletions
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) | |||
| 2442 | img->face_foreground = foreground; | 2442 | img->face_foreground = foreground; |
| 2443 | img->face_background = background; | 2443 | img->face_background = background; |
| 2444 | img->face_font_size = font_size; | 2444 | img->face_font_size = font_size; |
| 2445 | img->face_font_family = malloc (strlen (font_family) + 1); | 2445 | img->face_font_family = xmalloc (strlen (font_family) + 1); |
| 2446 | strcpy (img->face_font_family, font_family); | 2446 | strcpy (img->face_font_family, font_family); |
| 2447 | img->load_failed_p = ! img->type->load_img (f, img); | 2447 | img->load_failed_p = ! img->type->load_img (f, img); |
| 2448 | 2448 | ||
| @@ -9647,6 +9647,11 @@ DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, | |||
| 9647 | (RsvgHandle *, const char *, const RsvgRectangle *, | 9647 | (RsvgHandle *, const char *, const RsvgRectangle *, |
| 9648 | RsvgRectangle *, RsvgRectangle *, GError **)); | 9648 | RsvgRectangle *, RsvgRectangle *, GError **)); |
| 9649 | # endif | 9649 | # endif |
| 9650 | |||
| 9651 | # if LIBRSVG_CHECK_VERSION (2, 48, 0) | ||
| 9652 | DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet, | ||
| 9653 | (RsvgHandle *, const guint8 *, gsize, GError **)); | ||
| 9654 | # endif | ||
| 9650 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, | 9655 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, |
| 9651 | (RsvgHandle *, RsvgDimensionData *)); | 9656 | (RsvgHandle *, RsvgDimensionData *)); |
| 9652 | DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); | 9657 | DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); |
| @@ -9700,6 +9705,9 @@ init_svg_functions (void) | |||
| 9700 | LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); | 9705 | LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); |
| 9701 | LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); | 9706 | LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); |
| 9702 | #endif | 9707 | #endif |
| 9708 | #if LIBRSVG_CHECK_VERSION (2, 48, 0) | ||
| 9709 | LOAD_DLL_FN (library, rsvg_handle_set_stylesheet); | ||
| 9710 | #endif | ||
| 9703 | LOAD_DLL_FN (library, rsvg_handle_get_dimensions); | 9711 | LOAD_DLL_FN (library, rsvg_handle_get_dimensions); |
| 9704 | LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); | 9712 | LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); |
| 9705 | 9713 | ||
| @@ -9740,6 +9748,9 @@ init_svg_functions (void) | |||
| 9740 | # undef rsvg_handle_get_geometry_for_layer | 9748 | # undef rsvg_handle_get_geometry_for_layer |
| 9741 | # endif | 9749 | # endif |
| 9742 | # undef rsvg_handle_get_dimensions | 9750 | # undef rsvg_handle_get_dimensions |
| 9751 | # if LIBRSVG_CHECK_VERSION (2, 48, 0) | ||
| 9752 | # undef rsvg_handle_set_stylesheet | ||
| 9753 | # endif | ||
| 9743 | # undef rsvg_handle_get_pixbuf | 9754 | # undef rsvg_handle_get_pixbuf |
| 9744 | # if LIBRSVG_CHECK_VERSION (2, 32, 0) | 9755 | # if LIBRSVG_CHECK_VERSION (2, 32, 0) |
| 9745 | # undef g_file_new_for_path | 9756 | # undef g_file_new_for_path |
| @@ -9773,6 +9784,9 @@ init_svg_functions (void) | |||
| 9773 | fn_rsvg_handle_get_geometry_for_layer | 9784 | fn_rsvg_handle_get_geometry_for_layer |
| 9774 | # endif | 9785 | # endif |
| 9775 | # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions | 9786 | # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions |
| 9787 | # if LIBRSVG_CHECK_VERSION (2, 48, 0) | ||
| 9788 | # define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet | ||
| 9789 | # endif | ||
| 9776 | # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf | 9790 | # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf |
| 9777 | # if LIBRSVG_CHECK_VERSION (2, 32, 0) | 9791 | # if LIBRSVG_CHECK_VERSION (2, 32, 0) |
| 9778 | # define g_file_new_for_path fn_g_file_new_for_path | 9792 | # define g_file_new_for_path fn_g_file_new_for_path |