Skip to content

Commit caa28f0

Browse files
committed
Port LIBRSVG_CHECK_VERSION fix to picky cpp
* src/image.c (LIBRSVG_CHECK_VERSION): Define to yield false if it isn’t already defined. (svg_load_image): Port to C preprocessors that check the syntax of the entire preprocessing expression before evaluating any of it.
1 parent 8b78975 commit caa28f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/image.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9248,6 +9248,11 @@ svg_image_p (Lisp_Object object)
92489248

92499249
# include <librsvg/rsvg.h>
92509250

9251+
/* librsvg is too old for us if it doesn't define this macro. */
9252+
# ifndef LIBRSVG_CHECK_VERSION
9253+
# define LIBRSVG_CHECK_VERSION(v, w, x) false
9254+
# endif
9255+
92519256
# ifdef WINDOWSNT
92529257

92539258
/* Restore the original definition of __MINGW_MAJOR_VERSION. */
@@ -9465,8 +9470,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
94659470
#if GNUC_PREREQ (4, 6, 0)
94669471
#pragma GCC diagnostic push
94679472
#endif
9468-
#if defined LIBRSVG_CHECK_VERSION && LIBRSVG_CHECK_VERSION (2, 45, 1) \
9469-
&& GNUC_PREREQ (4, 2, 0)
9473+
#if LIBRSVG_CHECK_VERSION (2, 45, 1) && GNUC_PREREQ (4, 2, 0)
94709474
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
94719475
#endif
94729476

0 commit comments

Comments
 (0)