Skip to content

Commit 17b125e

Browse files
committed
cfg: Add CAIRO_VERSION_ENCODE()
Add CAIRO_VERSION_ENCODE() to fix undefined function-like macro error.
1 parent fdd7b1d commit 17b125e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

cfg/cairo.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<define name="CAIRO_MIME_TYPE_PNG" value="&quot;image/png&quot;"/>
2222
<define name="CAIRO_MIME_TYPE_URI" value="&quot;text/x-uri&quot;"/>
2323
<define name="CAIRO_MIME_TYPE_UNIQUE_ID" value="&quot;application/x-cairo.uuid&quot;"/>
24+
<define name="CAIRO_VERSION_ENCODE(major, minor, micro)" value="(((major) * 10000) + ((minor) * 100) + ((micro) * 1))"/>
2425
<!-- ########## cairo Allocation / Deallocation ########## -->
2526
<!-- ########## cairo Functions ########## -->
2627
<!-- cairo_t * cairo_create (cairo_surface_t *target); -->

test/cfg/cairo.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#include <cairo.h>
1111

12+
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 3)
13+
#endif
14+
1215
void validCode(cairo_surface_t *target)
1316
{
1417
cairo_t * cairo1 = cairo_create(target);

0 commit comments

Comments
 (0)