diff options
| author | Paul Eggert | 2019-05-30 15:06:39 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-05-30 15:29:50 -0700 |
| commit | 7871c3dc9f38a32e1658a3579069a988b0d99623 (patch) | |
| tree | b5da4abb3223f80d8ab3acd65cd1bc64ef4cb1fd /src | |
| parent | d93f4bda7ab3a5230d9155a93e2a3759690e3101 (diff) | |
| download | emacs-7871c3dc9f38a32e1658a3579069a988b0d99623.tar.gz emacs-7871c3dc9f38a32e1658a3579069a988b0d99623.zip | |
Pacify librsvg 2.45.1 and later
* src/image.c (svg_load_image): Pacify librsvg 2.45.1 and later,
and add a FIXME comment about the deprecated librsvg functions.
Backport from master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index 50515e1a422..bda60c03a14 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9306,6 +9306,17 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 9306 | if (filename) | 9306 | if (filename) |
| 9307 | rsvg_handle_set_base_uri(rsvg_handle, filename); | 9307 | rsvg_handle_set_base_uri(rsvg_handle, filename); |
| 9308 | 9308 | ||
| 9309 | /* Suppress GCC deprecation warnings starting in librsvg 2.45.1 for | ||
| 9310 | rsvg_handle_write and rsvg_handle_close. FIXME: Use functions | ||
| 9311 | like rsvg_handle_new_from_gfile_sync on newer librsvg versions, | ||
| 9312 | and remove this hack. */ | ||
| 9313 | #if GNUC_PREREQ (4, 6, 0) | ||
| 9314 | #pragma GCC diagnostic push | ||
| 9315 | #endif | ||
| 9316 | #if LIBRSVG_CHECK_VERSION (2, 45, 1) && GNUC_PREREQ (4, 2, 0) | ||
| 9317 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
| 9318 | #endif | ||
| 9319 | |||
| 9309 | /* Parse the contents argument and fill in the rsvg_handle. */ | 9320 | /* Parse the contents argument and fill in the rsvg_handle. */ |
| 9310 | rsvg_handle_write (rsvg_handle, (unsigned char *) contents, size, &err); | 9321 | rsvg_handle_write (rsvg_handle, (unsigned char *) contents, size, &err); |
| 9311 | if (err) goto rsvg_error; | 9322 | if (err) goto rsvg_error; |
| @@ -9315,6 +9326,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 9315 | rsvg_handle_close (rsvg_handle, &err); | 9326 | rsvg_handle_close (rsvg_handle, &err); |
| 9316 | if (err) goto rsvg_error; | 9327 | if (err) goto rsvg_error; |
| 9317 | 9328 | ||
| 9329 | #if GNUC_PREREQ (4, 6, 0) | ||
| 9330 | #pragma GCC diagnostic pop | ||
| 9331 | #endif | ||
| 9332 | |||
| 9318 | rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); | 9333 | rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); |
| 9319 | if (! check_image_size (f, dimension_data.width, dimension_data.height)) | 9334 | if (! check_image_size (f, dimension_data.width, dimension_data.height)) |
| 9320 | { | 9335 | { |