diff options
| author | Eli Zaretskii | 2020-11-09 17:35:52 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2020-11-09 17:35:52 +0200 |
| commit | 3de31e7b71353bc35d994dc924fae5178f09130b (patch) | |
| tree | 90e4d54dc2440390d0de2139f37d3d223f43605c /src | |
| parent | bffd5d3a9d44ed99d6a573dc0fabe542d6b3bb8b (diff) | |
| download | emacs-3de31e7b71353bc35d994dc924fae5178f09130b.tar.gz emacs-3de31e7b71353bc35d994dc924fae5178f09130b.zip | |
Fix compilation of image.c on MS-Windows
This is a followup to last change in image.c.
* src/image.c (rsvg_handle_get_intrinsic_dimensions): Define to
call fn_rsvg_handle_get_intrinsic_dimensions.
(svg_css_length_to_pixels): Compile only for librsvg >= 2.46.0, as
RsvgLength type was not defined before.
Diffstat (limited to 'src')
| -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 b4cb1b7bf83..d207f78e04b 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9542,19 +9542,19 @@ DEF_DLL_FN (void, rsvg_handle_set_base_uri, (RsvgHandle *, const char *)); | |||
| 9542 | DEF_DLL_FN (gboolean, rsvg_handle_write, | 9542 | DEF_DLL_FN (gboolean, rsvg_handle_write, |
| 9543 | (RsvgHandle *, const guchar *, gsize, GError **)); | 9543 | (RsvgHandle *, const guchar *, gsize, GError **)); |
| 9544 | DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); | 9544 | DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); |
| 9545 | #endif | 9545 | # endif |
| 9546 | 9546 | ||
| 9547 | #if LIBRSVG_CHECK_VERSION (2, 46, 0) | 9547 | # if LIBRSVG_CHECK_VERSION (2, 46, 0) |
| 9548 | DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, | 9548 | DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, |
| 9549 | RsvgHandle *, gboolean *, RsvgLength *, gboolean *, | 9549 | RsvgHandle *, gboolean *, RsvgLength *, gboolean *, |
| 9550 | RsvgLength *, gboolean *, RsvgRectangle *)); | 9550 | RsvgLength *, gboolean *, RsvgRectangle *)); |
| 9551 | DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, | 9551 | DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, |
| 9552 | (RsvgHandle *, const char *, const RsvgRectangle *, | 9552 | (RsvgHandle *, const char *, const RsvgRectangle *, |
| 9553 | RsvgRectangle *, RsvgRectangle *, GError **)); | 9553 | RsvgRectangle *, RsvgRectangle *, GError **)); |
| 9554 | #else | 9554 | # else |
| 9555 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, | 9555 | DEF_DLL_FN (void, rsvg_handle_get_dimensions, |
| 9556 | (RsvgHandle *, RsvgDimensionData *)); | 9556 | (RsvgHandle *, RsvgDimensionData *)); |
| 9557 | #endif | 9557 | # endif |
| 9558 | DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); | 9558 | DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); |
| 9559 | DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); | 9559 | DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); |
| 9560 | DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); | 9560 | DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); |
| @@ -9642,6 +9642,7 @@ init_svg_functions (void) | |||
| 9642 | # undef g_object_unref | 9642 | # undef g_object_unref |
| 9643 | # undef g_type_init | 9643 | # undef g_type_init |
| 9644 | # if LIBRSVG_CHECK_VERSION (2, 46, 0) | 9644 | # if LIBRSVG_CHECK_VERSION (2, 46, 0) |
| 9645 | # undef rsvg_handle_get_intrinsic_dimensions | ||
| 9645 | # undef rsvg_handle_get_geometry_for_layer | 9646 | # undef rsvg_handle_get_geometry_for_layer |
| 9646 | # else | 9647 | # else |
| 9647 | # undef rsvg_handle_get_dimensions | 9648 | # undef rsvg_handle_get_dimensions |
| @@ -9672,7 +9673,10 @@ init_svg_functions (void) | |||
| 9672 | # define g_type_init fn_g_type_init | 9673 | # define g_type_init fn_g_type_init |
| 9673 | # endif | 9674 | # endif |
| 9674 | # if LIBRSVG_CHECK_VERSION (2, 46, 0) | 9675 | # if LIBRSVG_CHECK_VERSION (2, 46, 0) |
| 9675 | # define rsvg_handle_get_geometry_for_layer fn_rsvg_handle_get_geometry_for_layer | 9676 | # define rsvg_handle_get_intrinsic_dimensions \ |
| 9677 | fn_rsvg_handle_get_intrinsic_dimensions | ||
| 9678 | # define rsvg_handle_get_geometry_for_layer \ | ||
| 9679 | fn_rsvg_handle_get_geometry_for_layer | ||
| 9676 | # else | 9680 | # else |
| 9677 | # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions | 9681 | # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions |
| 9678 | # endif | 9682 | # endif |
| @@ -9746,6 +9750,7 @@ svg_load (struct frame *f, struct image *img) | |||
| 9746 | return success_p; | 9750 | return success_p; |
| 9747 | } | 9751 | } |
| 9748 | 9752 | ||
| 9753 | #if LIBRSVG_CHECK_VERSION (2, 46, 0) | ||
| 9749 | static double | 9754 | static double |
| 9750 | svg_css_length_to_pixels (RsvgLength length) | 9755 | svg_css_length_to_pixels (RsvgLength length) |
| 9751 | { | 9756 | { |
| @@ -9783,6 +9788,7 @@ svg_css_length_to_pixels (RsvgLength length) | |||
| 9783 | 9788 | ||
| 9784 | return value; | 9789 | return value; |
| 9785 | } | 9790 | } |
| 9791 | #endif | ||
| 9786 | 9792 | ||
| 9787 | /* Load frame F and image IMG. CONTENTS contains the SVG XML data to | 9793 | /* Load frame F and image IMG. CONTENTS contains the SVG XML data to |
| 9788 | be parsed, SIZE is its size, and FILENAME is the name of the SVG | 9794 | be parsed, SIZE is its size, and FILENAME is the name of the SVG |