GNOME Bugzilla – Bug 664666
libgxps fails to build with libpng15 headers
Last modified: 2011-11-25 10:14:37 UTC
Starting with libpng15, png.h no longer #includes zlib.h. As a result, building libgxps-0.2.0 fails: gxps-png-writer.c: In function ‘gxps_png_writer_image_writer_init’: gxps-png-writer.c:142:57: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function) gxps-png-writer.c:142:57: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [xpstopng-gxps-png-writer.o] Error 1 Since the only name from zlib.h that libgxps needs is Z_BEST_COMPRESSION, this error can be trivially fixed by #defining Z_BEST_COMPRESSION to its canonical value, 9. Alternatively, gxps-png-writer.c could #include zlib.h, but that would presumably require adding a configure check for zlib headers.
Created attachment 202018 [details] [review] proposed patch
Review of attachment 202018 [details] [review]: Pushed to git master, thanks!