$NetBSD: patch-af,v 1.3 2011/05/21 17:23:10 wiz Exp $ Do not redeclare png functions. png_ptr's members are hidden now, so don't access them. XXX: this patch won't work if some bytes were already written, but why should they have been? Should be done better by upstream. --- src/mngutil.c.orig 2004-02-14 10:55:36.000000000 +0000 +++ src/mngutil.c @@ -30,13 +30,6 @@ #include #include "mngutil.h" -extern void png_write_data (png_structp png_ptr, - png_bytep data,png_size_t length); -extern void png_save_uint_32 (png_bytep buf, png_uint_32 i); -extern void png_save_uint_16 (png_bytep buf, png_uint_16 i); -extern void png_write_chunk (png_structp png_ptr, - png_bytep chunk_name, png_bytep data, png_size_t length); - png_byte mng_sig[8] = {138, 77, 78, 71, 13, 10, 26, 10}; /* @@ -45,9 +38,8 @@ png_byte mng_sig[8] = {138, 77, 78, 71, void mng_write_sig (png_structp png_ptr) { - /* write the rest of the 8 byte signature */ - png_write_data (png_ptr, &mng_sig[png_ptr->sig_bytes], - (png_size_t)8 - png_ptr->sig_bytes); + /* write the 8 byte signature */ + png_write_chunk_data (png_ptr, mng_sig, 8); }