summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>2016-05-18 02:19:55 (EDT)
committer Gianfranco Costamagna <costamagnagianfranco@yahoo.it>2016-05-18 02:21:52 (EDT)
commiteed1888ade8274b106b06a55af29ef9cd33c5917 (patch)
tree7b7b7c2b726172b32a08aabbf7520c0b0c6f1927
parent196f51790bbaff594525935adeab1247bb798946 (diff)
downloadxcftools-eed1888ade8274b106b06a55af29ef9cd33c5917.zip
xcftools-eed1888ade8274b106b06a55af29ef9cd33c5917.tar.gz
xcftools-eed1888ade8274b106b06a55af29ef9cd33c5917.tar.bz2
Fix libpng1.5 issue, keeping backword-compatible code, from Debian
-rw-r--r--xcf2png.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xcf2png.c b/xcf2png.c
index e8b5c1a..6721f3d 100644
--- a/xcf2png.c
+++ b/xcf2png.c
@@ -59,7 +59,14 @@ my_error_callback(png_structp png_ptr, png_const_charp errormsg)
FatalUnexpected(_("Libpng error '%s'"),errormsg);
}
-
+#ifndef png_voidp_NULL
+#define png_voidp_NULL NULL
+#endif
+
+#ifndef png_error_ptr_NULL
+#define png_error_ptr_NULL NULL
+#endif
+
static void
init_output(void)
{
@@ -71,9 +78,9 @@ init_output(void)
outfile = openout(flatspec.output_filename);
libpng = png_create_write_struct(PNG_LIBPNG_VER_STRING,
- NULL,
+ png_voidp_NULL,
my_error_callback,
- NULL);
+ png_error_ptr_NULL);
if( !libpng )
FatalUnexpected(_("Couldn't initialize libpng library"));