summaryrefslogtreecommitdiff
path: root/examples/cairoshape.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cairoshape.c')
-rw-r--r--examples/cairoshape.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/cairoshape.c b/examples/cairoshape.c
index a778cd76..cdb08702 100644
--- a/examples/cairoshape.c
+++ b/examples/cairoshape.c
@@ -314,7 +314,13 @@ main (int argc, char **argv)
cairo_destroy (cr);
/* Write out the surface as PNG */
+
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
status = cairo_surface_write_to_png (surface, filename);
+#else
+ status = CAIRO_STATUS_PNG_ERROR; /* Not technically correct, but... */
+#endif
+
cairo_surface_destroy (surface);
if (status != CAIRO_STATUS_SUCCESS)